Corrado wrote:
Dear R,

the condition: identical(length(x),1) returns FALSE
but

print(length(x))

returns 1 and:

is.vector(x) is TRUE.
is.integer(length(x)) is TRUE
length(x) ==1 is TRUE

I am puzzled.

Regards


> is.integer(length(x))
[1] TRUE
> is.integer(1)
[1] FALSE


Hence:
> identical(length(x), 1L)
[1] TRUE


Uwe Ligges

______________________________________________
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