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
ot;slim", "wide")
>>>
>>> l <- list()
>>> for(h in height){
>>>l[[h]] <- list()
>>>for(w in width){
>>>l[[h]][[w]] <- paste(h, w, sep="/") # doSomething()
>>>}
>>
>>
>> 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
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
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
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
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...@
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
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
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
10 matches
Mail list logo