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[
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
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
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
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
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
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
7 matches
Mail list logo