Try this:

do.call("[", c(list(HairEyeColor), list(TRUE, 3, 1)))

On Wed, Aug 20, 2008 at 7:16 PM, Søren Højsgaard
<[EMAIL PROTECTED]> wrote:
> Consider the extraction
>
>> HairEyeColor[,3,1]
> Black Brown   Red Blond
>   10    25     7     5
>
> Suppose I have the appropriate dimensions and levels given as variables, e.g.
> d1 <-2
> l1 <-3
> d2 <-3
> l2 <-1
>
> How can I then make the "extraction" above using d1, l1, d2, l2  (for an 
> array of arbitrary dimension)?
>
> Best regards
> Søren
>
>
> ______________________________________________
> R-help@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@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.

Reply via email to