Hi,

In my function, I want to allow input to be a vector or a data.frame.
Certain operations need to be done if the length or nrows exceeds one, but 
since "nrow" doesn't work for vectors, I cannot simply use

if( nrow(input)>1 | length(input)>1 ) ...

So is there a more elegant way to do this then with the following code?

if( if(is.vector(input)) length(input)>1  else nrow(input)>1  )  ...

thanks ahead,
Berry                                     
______________________________________________
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