diff --git a/DESCRIPTION b/DESCRIPTION index 26b14df..59b593c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: interlacer Title: Read Tabular Data With Interlaced Values And Missing Reasons -Version: 0.3.4 +Version: 0.3.5 Authors@R: person("Kyle", "Husmann", , "kdh38@psu.edu", role = c("aut", "cre")) Description: Textual tabular data sources often encode values and missing diff --git a/R/interlaced.R b/R/interlaced.R index 57740a2..9fb738e 100644 --- a/R/interlaced.R +++ b/R/interlaced.R @@ -328,14 +328,16 @@ vec_ptype_abbr.interlacer_interlaced <- function(x, ...) { #' @export format.interlacer_interlaced <- function(x, ...) { - v = format(value_channel(x)) - m = format(na_channel(x)) + v <- value_channel(x) + m <- na_channel(x) - if_else( - is.empty(x), paste0("<<", m, ">>"), + format( if_else( - is.na(x), paste0("<", m, ">"), - v + is.empty(x), "<>", + if_else( + is.na(x), paste0("<", as.character(m), ">"), + format(v) + ) ) ) }