Does anyone know how to remove an empty string from the named vector? I tried the following but could not get what I wanted.
X <- c('a', NA, '', 'b')
names(X) <- rep("d",4)
then I applied one the stringi function as fallow
stringi::stri_remove_empty(names(X)) # it return this "a" NA "b"
stringi::stri_remove_empty(X) # it return just the names "d" "d" "d" "d"
But actually I want get as following
d d d
"a" "na" "b"
appreciate your help
best adr