Dear All, I tried to invoke plot for a matrix of?196475 x2 dimension. I loaded the data with read.table. On one dimension, there are strings (names) and on the other dimension, the floats between 0 and 1. When I invoked plot by setting x to names and y to floats and ylim = c(0,1), I got the following error message: Error in rep.int(boxwex, n) : negative length vectors are not allowed Does it come from the large-size dimension of the matrix and which vectors get a negative length? Best, Carol
Error in rep.int(boxwex, n) : negative length vectors are not allowed
4 messages · carol white, R. Michael Weylandt, William Dunlap
Sorry for the error: the first column is of the?string?type and the second column of float, respectively. ----- Forwarded Message ----- From: carol white <wht_crl at yahoo.com> To: "r-help at stat.math.ethz.ch" <r-help at stat.math.ethz.ch> Cc: Sent: Wednesday, February 15, 2012 4:46 PM Subject: Error in rep.int(boxwex, n) : negative length vectors are not allowed Dear All, I tried to invoke plot for a matrix of?196475 x2 dimension. I loaded the data with read.table. On one dimension, there are strings (names) and on the other dimension, the floats between 0 and 1. When I invoked plot by setting x to names and y to floats and ylim = c(0,1), I got the following error message: Error in rep.int(boxwex, n) : negative length vectors are not allowed Does it come from the large-size dimension of the matrix and which vectors get a negative length? Best, Carol
Can you give minimal reproducible code? I'm worried about using strings for the x axis but it'll be easier to diagnose with data and actual code. Use dput() to put your data sample (not your whole data set) in email-friendly plain text. Michael
On Wed, Feb 15, 2012 at 10:46 AM, carol white <wht_crl at yahoo.com> wrote:
Dear All, I tried to invoke plot for a matrix of?196475 x2 dimension. I loaded the data with read.table. On one dimension, there are strings (names) and on the other dimension, the floats between 0 and 1. When I invoked plot by setting x to names and y to floats and ylim = c(0,1), I got the following error message: Error in rep.int(boxwex, n) : negative length vectors are not allowed Does it come from the large-size dimension of the matrix and which vectors get a negative length? Best, Carol
______________________________________________ R-help at 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.
It looks like a bug in bxp (which plot(factor,numeric) calls) -- it tries to make a nGroup*nGroup long vector out of boxwex:
f <- rep(factor(as.character(1:25000)), len=50000) x <- sin(1:50000) boxplot(split(x, f))
Error in rep.int(boxwex, n) : cannot allocate vector of length 625000000 For certain lengths that nGroup*nGroup will wrap around to negative numbers can cause the 'no negative length vectors' message. Perhaps it means to do rep(boxwex, length=n). Do you really want that many boxplots on a page? Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com
-----Original Message----- From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] On Behalf Of R. Michael Weylandt Sent: Wednesday, February 15, 2012 6:23 PM To: carol white Cc: r-help at stat.math.ethz.ch Subject: Re: [R] Error in rep.int(boxwex, n) : negative length vectors are not allowed Can you give minimal reproducible code? I'm worried about using strings for the x axis but it'll be easier to diagnose with data and actual code. Use dput() to put your data sample (not your whole data set) in email-friendly plain text. Michael On Wed, Feb 15, 2012 at 10:46 AM, carol white <wht_crl at yahoo.com> wrote:
Dear All, I tried to invoke plot for a matrix of?196475 x2 dimension. I loaded the data with read.table. On
one dimension, there are strings (names) and on the other dimension, the floats between 0 and 1. When I invoked plot by setting x to names and y to floats and ylim = c(0,1), I got the following error message:
Error in rep.int(boxwex, n) : negative length vectors are not allowed Does it come from the large-size dimension of the matrix and which vectors get a negative length? Best, Carol
______________________________________________ R-help at 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.
______________________________________________ R-help at 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.