not that its much shorter:

length( table( sapply( list(x,y,z), length ) ) ) == 1

Bendix
----------------------
Bendix Carstensen
Senior Statistician
Steno Diabetes Center
Niels Steensens Vej 2
DK-2820 Gentofte
Denmark
tel: +45 44 43 87 38
mob: +45 30 75 87 38
fax: +45 44 43 07 06
[EMAIL PROTECTED]
www.biostat.ku.dk/~bxc
----------------------



> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf Of Manuel 
> Gutierrez
> Sent: Thursday, December 09, 2004 9:09 AM
> To: [EMAIL PROTECTED]
> Subject: [R] test multiple objects for being equal length
> 
> 
> I could not find any help pages on How to test many
> objects for being of equal length
> Something like identical for more than two objects?
> x<-1:6
> y<-1:10
> z<-3:5
> ## For two objects I can do:
> identical(length(x),length(y))
> ## For more than two I currently can do: 
> length(unique(c(length(x),length(y),length(z))))==1
> 
> but there must be a better way.
> Thanks,
> M
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list 
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read 
> the posting guide! http://www.R-project.org/posting-guide.html
>

______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to