On Wed, Aug 06, 2008 at 11:53:25AM -0400, Faheem Mitha wrote:
>
> Hi,
>
> Consider the following
>
>> x = c(1,2)
>> y = c(3,4)
>> d = data.frame(cbind(x,y))
>> d$x
> [1] 1 2
>> d$"x"
> [1] 1 2
>>
>> foo = function(val)
> + {
> + return(d$val)
> + }
>>
>> bar = function()
> + {
> + return(d$"x")
On Wed, 6 Aug 2008, Faheem Mitha wrote:
Hi,
Consider the following
x = c(1,2)
y = c(3,4)
d = data.frame(cbind(x,y))
d$x
[1] 1 2
d$"x"
[1] 1 2
foo = function(val)
+ {
+ return(d$val)
+ }
bar = function()
+ {
+ return(d$"x")
+ }
foo("x")
NULL
bar()
[1] 1 2
I'm a little surpr
On Wed, 6 Aug 2008, milton ruser wrote:
Try this
foo1 = function(val)
{
return(d[val])
}
foo1("x")
Thanks for the suggestion. I appreciate it. My original question wasn't
just a pragmatic "how do I do this" type question. I was also wondering
about the language issues involved.
Try this
foo1 = function(val)
{
return(d[val])
}
foo1("x")
Good luck
miltinho astronauta
brazil
On 8/6/08, Faheem Mitha <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> Consider the following
>
> x = c(1,2)
>> y = c(3,4)
>> d = data.frame(cbind(x,y))
>> d$x
>>
> [1] 1 2
>
>> d$"x"
>>
> [1] 1
4 matches
Mail list logo