Thanks, just the clue I needed, worked a treat.
baptiste auguie-5 wrote:
>
> Hi,
>
> I think this is a case where you should use the ?"[[" extraction
> operator rather than "$",
>
> d = data.frame(a=1:3)
> mytarget = "a"
> d[[mytarget]]
>
>
> HTH,
>
> baptiste
>
> 2009/10/11 tdm :
>>
>> H
Hi,
I think this is a case where you should use the ?"[[" extraction
operator rather than "$",
d = data.frame(a=1:3)
mytarget = "a"
d[[mytarget]]
HTH,
baptiste
2009/10/11 tdm :
>
> Hi,
>
> I am passing a data frame and field name to a function. I've figured out how
> I can create the formula
Hi,
I am passing a data frame and field name to a function. I've figured out how
I can create the formula based on the passed in field name, but I'm
struggling to create a vector based in that field.
for example if I hard code with the actual field name
Y = df$Target, everything works fine.
bu
3 matches
Mail list logo