HenrikBengtsson / R.utils

🔧 R package: R.utils (this is *not* the utils package that comes with R itself)
https://henrikbengtsson.github.io/R.utils/
62 stars 14 forks source link

WISH: Add 'empty' argument to hpaste() #120

Closed HenrikBengtsson closed 3 years ago

HenrikBengtsson commented 4 years ago

Currently,

> x <- 1:2
> hpaste(x)
[1] "1, 2"

> x <- integer(0)
> hpaste(x)
character(0)

> x <- NULL
> hpaste(x)
character(0)

The proposal is to add support for:

> x <- NULL
> hpaste(x, empty = "<NULL>")
"<NULL>"

and

> x <- character(0)
> hpaste(x, empty = "")
""