Peter Alspach wrote:
Tena koe
Try either
L[foo()]
or
L[[foo()]]
These return subtly (or not so subtly depending on your point of view)
different results.
which is quite important, hence read the documentation. [] returns a
list of length 1 (or a vector of length 1 of type list) where [[]]
Hi, everybody. I have a list obj L, sth like
$`aaa`
[1] 5753
if the string 'aaa' is a returned value of a function foo(). what is
the right syntax form of L$foo()
I'm new to R, thanks in advance.
__
R-help@r-project.org mailing list
On Aug 26, 2009, at 11:35 PM, Ning Ma wrote:
Hi, everybody. I have a list obj L, sth like
$`aaa`
[1] 5753
if the string 'aaa' is a returned value of a function foo(). what is
the right syntax form of L$foo()
What do you really want to achieve or to learn? Pretty much anything
ending in
Tena koe
Try either
L[foo()]
or
L[[foo()]]
These return subtly (or not so subtly depending on your point of view)
different results.
HTH
Peter Alspach
-Original Message-
From: r-help-boun...@r-project.org
[mailto:r-help-boun...@r-project.org] On Behalf Of Ning Ma
Sent:
4 matches
Mail list logo