Le vendredi 18 novembre 2011 à 16:09 +0100, Jaensch, Steffen [TIBBE] a
écrit :
> Hi all,
>
> Can somebody explain why length("") returns 1 and not 0?
Probably because it contains one element, "".

> How do I test if a given string is the empty string?
a <- ""
a == ""
[1] TRUE

Seems to be enough to me. ;-)


Cheers

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to