Stephen Liu
2010-Nov-03 15:00 UTC
[R] longer object length is not a multiple of shorter object length
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 + 1Warning 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 B.R. Stephen L
David Winsemius
2010-Nov-03 15:03 UTC
[R] longer object length is not a multiple of shorter object length
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. TIAWhat does this return: c(length(x), length(y)) # ? David Winsemius, MD West Hartford, CT
Stephen Liu
2010-Nov-03 15:17 UTC
[R] longer object length is not a multiple of shorter object length
----- Original Message ---- From: David Winsemius <dwinsemius at comcast.net> To: Stephen Liu <satimis at yahoo.com> Cc: r-help at r-project.org Sent: Wed, November 3, 2010 11:03:18 PM Subject: Re: [R] longer object length is not a multiple of shorter object length - snip ->> 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)) # ?c(length(x), length(y)) [1] 5 11 B.R. Stephen L
David Winsemius
2010-Nov-03 15:25 UTC
[R] longer object length is not a multiple of shorter object length
On Nov 3, 2010, at 11:17 AM, Stephen Liu wrote:> ----- Original Message ---- > > From: David Winsemius <dwinsemius at comcast.net> > To: Stephen Liu <satimis at yahoo.com> > Cc: r-help at r-project.org > Sent: Wed, November 3, 2010 11:03:18 PM > Subject: Re: [R] longer object length is not a multiple of shorter > object length > > - snip - > >>> 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?You were not supposed to rectify it. That example was designed to show you what happens in R when two vectors (actually three) are offered to the Arithmetic operators. Read the material that is above and below that expression again.>>> Please help. TIA > >> What does this return: > >> c(length(x), length(y)) # ? > > c(length(x), length(y)) > [1] 5 11 > > > B.R. > Stephen L > >David Winsemius, MD West Hartford, CT
Apparently Analagous Threads
- An empty grey diagram
- longer object length, is not a multiple of shorter object length in: kappa * gcounts
- longer object length is not a multiple of shorter object length
- cv.glm and "longer object length is not a multiple of shorter object length" error
- Where the data file is stored?