Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread David Romano
Sorry, this was meant to go to the full list. -David On Sun, Feb 10, 2013 at 2:15 PM, David Romano wrote: > > > On Sun, Feb 10, 2013 at 1:59 PM, Bert Gunter wrote: > >> Please read the Help before posting. >> >> ?"$" says: >> > > It helps to know that $ must be quoted, so thanks again goes to D

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread Bert Gunter
Please read the Help before posting. ?"$" says: "Both [[ and $ select a single element of the list. The main difference is that $ **does not allow computed indices** , whereas [[ does. x$name is equivalent to x[["name", exact = FALSE]]. Also, the partial matching behavior of [[ can be controlled

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread Ben Bolker
Duncan Murdoch gmail.com> writes: > > On 13-02-10 4:06 PM, David Romano wrote: > > Hi everyone, > > > > I ran into the issue below while trying to execute a command of the form > > > > apply(list.names,1, function(x) F(favorite.list$x) ) > > > > where list.names is a character vector containing

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread David Romano
On Sun, Feb 10, 2013 at 1:40 PM, Duncan Murdoch wrote: > On 13-02-10 4:06 PM, David Romano wrote: > >> Hi everyone, >> >> I ran into the issue below while trying to execute a command of the form >> >> apply(list.names,1, function(x) F(favorite.list$x) ) >> >> where list.names is a character vecto

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread Duncan Murdoch
On 13-02-10 4:06 PM, David Romano wrote: Hi everyone, I ran into the issue below while trying to execute a command of the form apply(list.names,1, function(x) F(favorite.list$x) ) where list.names is a character vector containing the names of the elements of favorite.list and F is some functi

Re: [R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread R. Michael Weylandt
On Sun, Feb 10, 2013 at 9:06 PM, David Romano wrote: > Hi everyone, > > I ran into the issue below while trying to execute a command of the form > > apply(list.names,1, function(x) F(favorite.list$x) ) > > where list.names is a character vector containing the names of the elements > of favorite.l

[R] different behavior of $ with string literal vs string variable as argument

2013-02-10 Thread David Romano
Hi everyone, I ran into the issue below while trying to execute a command of the form apply(list.names,1, function(x) F(favorite.list$x) ) where list.names is a character vector containing the names of the elements of favorite.list and F is some function defined on a list element. Namely, the