I imagine this is incredibly simple but I cant seem to find the answer.
I am writing an IF statement but the test is if the object returns a character(0)
character(0)
Use the identical function to check this.
identical
a <- character(0) identical(a, character(0)) # returns TRUE identical(a, "") # returns FALSE identical(a, numeric(0)) # returns also FALSE