I have a function which returns the following vector in R
vec
#named character(0)
Since it is a named vector, I am not able to test the following on it
is.na()
is.na(vec)
# named logical(0)
is.null
is.null(vec)
# [1] FALSE
identical(vec,character(0)
identical(vec,character(0)
# [1] FALSE
How do I write a test on it to check if it is a named character(0) vector and then assign it to a NULL value?