Closed RobinHankin closed 10 months ago
Probably worth noting here that there is such a thing as an empty named vector
x <- 1:3
y <- setNames(1:3,letters[1:3])
x[x>4]
#> integer(0)
(z <- y[y>4])
#> named integer(0)
Also worth reminding myself that existing frab
functionality can deal with this:
suppressMessages(library("frab"))
y <- setNames(1:3,letters[1:3])
z <- y[y>4]
frab(z)
#> The empty frab object
fixed in 9c5f992
Above, the first call to
x[is.na(x)]
works fine, extracting elementy
. But the second fails.