[R] quote a column of a dataframe by its name

Rolf Turner rolf.turner at xtra.co.nz
Sat Oct 5 00:47:51 CEST 2013


On 10/05/13 05:15, John Kane wrote:
> X[,names(X)[4]]  works fine  for me.  I had never thought of doing this. Neat idea.

Perhaps I am being obtuse, but how would X[,names(X)[4]] differ from X[,4]?

     cheers,

     Rolf Turner



More information about the R-help mailing list