[R] Finding the position of a variable in a data.frame

Gabor Grothendieck ggrothendieck at gmail.com
Fri Aug 4 02:22:12 CEST 2006


On 8/3/06, John Kane <jrkrideau at yahoo.ca> wrote:
>
> --- Don MacQueen <macq at llnl.gov> wrote:
>
> > You don't need to find out the column index. This
> > works:
> >
> >     Df[5,'bat'] <- 100
> >
> > -Don
> >
>
> Thanks, I'd tried
> Df[5, bat] <- 100  :(
>
> I never thought of the ' ' being needed.

Right -- the quotes are not needed if you use $ but they are needed if
you use [.



More information about the R-help mailing list