[R] Anything like associative arrays in R?

2005-11-02 Thread kynn
Let me preface my question by stressing that I am much less interested in the answer than in learning a way I could have *found the answer myself*. (As helpful as the participants in this list are, I have far too many R-related questions to resolve by posting here, and as I've written before,

Re: [R] Anything like associative arrays in R?

2005-11-02 Thread jim holtman
Is this what you want? x <- list() for (i in c('test', 'some', 'more')){ for(j in c('lv1', 'lv2', 'lv3')){ x[[i]][[j]] <- runif(10) } } x x[['some']][['lv2']] On 11/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > Let me preface my question by stressing that I am much less interes

Re: [R] Anything like associative arrays in R?

2005-11-02 Thread Sean Davis
On 11/2/05 8:24 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > > Let me preface my question by stressing that I am much less interested > in the answer than in learning a way I could have *found the answer > myself*. (As helpful as the participants in this list are, I have far > t

Re: [R] Anything like associative arrays in R?

2005-11-02 Thread James Reilly
Also, if you want to read in various data files as in your Perl example, you could replace the line inside both loops with something like this: x[[i]][[j]] <- read.table(paste('/path/to/data/',i,'_',j,'.dat',sep='')) See http://cran.r-project.org/doc/manuals/R-intro.html#Character-vectors for ano