Re: [R] Problem with expand.grid() function

2010-03-29 Thread Dennis Murphy
Hi: 2^40 [1] 1.099512e+12 Do you have enough memory for almost 1.1 trillion rows and 40 columns? This is a good example of the 'power law' that Stephen Strogatz discussed in his New York Times article today: http://opinionator.blogs.nytimes.com/2010/03/28/power-tools/?hp HTH, Dennis On Mon,

Re: [R] Problem with expand.grid() function

2010-03-29 Thread Bogaso
OK. I understood this. But the problem is I have to execute that for atleast 130. Is there any possibility to break that calculation into some sub-section so that individual section can carry out the calculation efficiently? Thanks, -- View this message in context:

Re: [R] Problem with expand.grid() function

2010-03-29 Thread Erik Iverson
Bogaso wrote: OK. I understood this. But the problem is I have to execute that for atleast 130. Is there any possibility to break that calculation into some sub-section so that individual section can carry out the calculation efficiently? Thanks, Why do you 'have' to do this? What are you

Re: [R] Problem with expand.grid

2009-12-23 Thread Martin Maechler
KJ == Keith Jewell k.jew...@campden.co.uk on Tue, 22 Dec 2009 16:02:49 - writes: KJ Hi All, KJ This example code KJ KJ dDF - structure(list(y = c(4.75587, 4.8451, 5.04139, 4.85733, 5.20412, KJ 5.92428, 5.69897, 4.78958, 4, 4), t = c(0, 48, 144, 192,

Re: [R] Problem with expand.grid

2009-12-22 Thread Keith Jewell
Just confirming it isn't the bug fixed in 2.11.0dev, and giving an even simpler example: R version 2.11.0 Under development (unstable) (2009-12-20 r50794) expand.grid(data.frame(y=1:10, t=1:10)) Error in `[[-.data.frame`(`*tmp*`, i, value = c(1L, 2L, 3L, 4L, 5L, 6L, : replacement has 100

Re: [R] Problem with expand.grid

2009-12-22 Thread Prof Brian Ripley
1) Look at the help: a data frame may be a list, but do pass a list such as unclass(dDF) when it says 'list'. 2) You have 7 columns of 10 items, which gives 10 million rows. Is that really what you want (especially as some of the columns are constant)? It's an object of ca 500MB. On Tue,

Re: [R] Problem with expand.grid

2009-12-22 Thread Henrique Dallazuanna
The help page says: ...: vectors, factors or a list containing these. So, you can try this: expand.grid(as.list(dDF)) On Tue, Dec 22, 2009 at 2:19 PM, Keith Jewell k.jew...@campden.co.uk wrote: Just confirming it isn't the bug fixed in 2.11.0dev, and giving an even simpler example: R

Re: [R] Problem with expand.grid

2009-12-22 Thread Ken Knoblauch
Keith Jewell k.jewell at campden.co.uk writes: Hi All, This example code dDF - structure(list(y = c(4.75587, 4.8451, 5.04139, 4.85733, 5.20412, 5.92428, 5.69897, 4.78958, 4, 4), t = c(0, 48, 144, 192, 240, 312, 360, 0, 48, 144), Batch = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1

Re: [R] Problem with expand.grid

2009-12-22 Thread David Winsemius
On Dec 22, 2009, at 11:19 AM, Keith Jewell wrote: Just confirming it isn't the bug fixed in 2.11.0dev, and giving an even simpler example: R version 2.11.0 Under development (unstable) (2009-12-20 r50794) expand.grid(data.frame(y=1:10, t=1:10)) Error in `[[-.data.frame`(`*tmp*`, i, value

Re: [R] Problem with expand.grid

2009-12-22 Thread Keith Jewell
bangs head on desk Thanks, Prof Ripley (and everyone else who's responding while I type this!). I thought I was being stupid. What I wanted was: expand.grid(lapply(dDF, unique)) which works fine! hangs head in shame Seasonal greetings to all, Keith Jewell Prof Brian Ripley

Re: [R] Problem with expand.grid

2009-12-22 Thread Duncan Murdoch
On 22/12/2009 11:19 AM, Keith Jewell wrote: Just confirming it isn't the bug fixed in 2.11.0dev, and giving an even simpler example: The docs for expand.grid say it works on lists, but they don't mention dataframes. Although a dataframe is in many ways a list with extra structure,

Re: [R] Problem with expand.grid

2009-12-22 Thread Stavros Macrakis
Unfortunately, expand.grid doesn't validate the class of its argument, so it is reporting an internal error rather than something more intelligible. On Tue, Dec 22, 2009 at 11:19 AM, Keith Jewell k.jew...@campden.co.ukwrote: Just confirming it isn't the bug fixed in 2.11.0dev, and giving an