Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-21 Thread Tim Howard
12 11:34:06 +0100 From: Jessica Streicher To: David Winsemius Cc: R help Subject: Re: [R] Filling Lists or Arrays of variable dimensions Message-ID: Content-Type: text/plain; charset=us-ascii @David : In my mind it was quite complete enough. @William: Thanks, didn't know you could do th

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-21 Thread Jessica Streicher
ot;slim", "wide") >>> >>> l <- list() >>> for(h in height){ >>>l[[h]] <- list() >>>for(w in width){ >>>l[[h]][[w]] <- paste(h, w, sep="/") # doSomething() >>>} >>

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread David Winsemius
>> >> grid <- expand.grid(height, width, stringsAsFactors=FALSE) >> as.character(grid[1,]) >> # [1] "high" "slim", not the [1] "1" "1" you get with stringsAsFactors=TRUE >> l[[ as.character(grid[1, ]) ]] >> # [1] "hi

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread William Dunlap
mation. Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: Jessica Streicher [mailto:j.streic...@micromata.de] > Sent: Thursday, December 20, 2012 10:01 AM > To: William Dunlap > Cc: Chris Campbell; R help > Subject: Re: [R] Filling Li

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread William Dunlap
ic...@micromata.de] > Sent: Thursday, December 20, 2012 10:01 AM > To: William Dunlap > Cc: Chris Campbell; R help > Subject: Re: [R] Filling Lists or Arrays of variable dimensions > > Really must have been unclear at some point, sorry. > > William, thats interesting, b

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread Chris Campbell
ile. +44 (0) 7929 628349 mailto:ccampb...@mango-solutions.comĀ | http://www.mango-solutions.com Mango Solutions 2 Methuen Park Chippenham Wiltshire SN14 OGB UK -Original Message- From: Jessica Streicher [mailto:j.streic...@micromata.de] Sent: 20 December 2012 18:01 To: William Dunlap Cc: Chris Cam

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread Jessica Streicher
haracter(grid[1, ]) ]] > # [1] "high/slim" > l[[ as.character(grid[1, ]) ]] <- 1 > l[[ as.character(grid[1, ]) ]] > # [1] 1 > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > >> -Original Message- >> From: r-help-boun...@

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread William Dunlap
uot;1" you get with stringsAsFactors=TRUE l[[ as.character(grid[1, ]) ]] # [1] "high/slim" l[[ as.character(grid[1, ]) ]] <- 1 l[[ as.character(grid[1, ]) ]] # [1] 1 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-b

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread Jessica Streicher
Aggregate is highly confusing (and i would have appreciated if you used my example instead, i don't get it to do anything sensible on my stuff). And this seems not what i asked for anyway. This may be a named list but not named and structured as i want it at all. happy Christmas too On 20.12.2

Re: [R] Filling Lists or Arrays of variable dimensions

2012-12-20 Thread Chris Campbell
Dear Jessica Aggregate is a function that allows you to perform loops across multiple variables. tempData <- data.frame(height = rnorm(20, 100, 10), width = rnorm(20, 50, 5), par1 = rnorm(20)) tempData$htfac <- cut(tempData$height, c(0, 100, 200)) tempData$wdfac <- cut(te