[R] longer object length is not a multiple of shorter object length

David Winsemius dwinsemius at comcast.net
Wed Nov 3 16:03:18 CET 2010


On Nov 3, 2010, at 11:00 AM, Stephen Liu wrote:

> Hi folks,
>
> I'm following An Introduction to R
> http://cran.r-project.org/doc/manuals/R-intro.html#R-and-statistics
>
> to learn R.
>
> Coming to;
> 2.2 Vector arithmetic
>
>> v <- 2*x + y + 1
> Warning message:
> In 2 * x + y :
>  longer object length is not a multiple of shorter object length
>
> What does it mean?  How to rectify it?  Please help.  TIA

What does this return:

c(length(x), length(y))  # ?



David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list