Re: [R] convert list to numeric

2009-11-02 Thread Don MacQueen
An example will help show the difference between single vs. double brackets. ## xl is a list with three elements xl <- list( a=1:3, b=2:7, c=c('X','Y')) xl $a [1] 1 2 3 $b [1] 2 3 4 5 6 7 $c [1] "X" "Y" ## with single brackets, we get a subset. A subset of a list is still a list xl[

Re: [R] convert list to numeric

2009-11-02 Thread Adaikalavan Ramasamy
It's a way of extracting from a list. See help("[") or help("Extract"). dadrivr wrote: Great, that works very well. What is the purpose of double brackets vs single ones? I will remember next time to include a subset of the data, so that readers can run the script. Thanks again for your hel

Re: [R] convert list to numeric

2009-11-02 Thread Adaikalavan Ramasamy
It's a way of extracting from a list. See help("[") or help("Extract") Regards, Adai dadrivr wrote: Great, that works very well. What is the purpose of double brackets vs single ones? I will remember next time to include a subset of the data, so that readers can run the script. Thanks again

Re: [R] convert list to numeric

2009-11-02 Thread dadrivr
Great, that works very well. What is the purpose of double brackets vs single ones? I will remember next time to include a subset of the data, so that readers can run the script. Thanks again for your help! Benilton Carvalho wrote: > > it appears that what you really want is to use: > > ta

Re: [R] convert list to numeric

2009-11-01 Thread jim holtman
Can you at least provide an 'str' of the 'task' object (not sure if it is a dataframe; you said a 'list') so that we know what it looks like. It would also be helpful if you would provide a subset of the data that we could try out a script on it. The best way would be to post the first 10 or so r

Re: [R] convert list to numeric

2009-11-01 Thread Benilton Carvalho
it appears that what you really want is to use: task[[i]] instead of task[i] b On Nov 1, 2009, at 11:04 PM, dadrivr wrote: I would like to preface this by saying that I am new to R, so I would ask that you be patient and thorough, so that I'm not completely clueless. I am trying to con

[R] convert list to numeric

2009-11-01 Thread dadrivr
I would like to preface this by saying that I am new to R, so I would ask that you be patient and thorough, so that I'm not completely clueless. I am trying to convert a list to numeric so that I can perform computations on it (specifically mean-center the variable), but I am running into proble