I am looking for an elegant way how I can test the equality of lengths of
multiple vectors.

For example, this is working fine:

> length(rnorm(4)) == length(rnorm(5))
[1] FALSE
However this is not:

> length(rnorm(4)) == length(rnorm(5)) == length(rnorm(6))
Error: unexpected '==' in "length(rnorm(4)) == length(rnorm(5)) =="
Ofcourse I can test it by taking pairwise  vector i.e. (1,2), (1,3), (2,3)
and conclude all are of same length only if all 3 tests are passed. Is there
any better (R) way to doing that?

Thanks in advance

        [[alternative HTML version deleted]]

______________________________________________
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