On Oct 5, 2013, at 00:47 , Rolf Turner wrote:
> 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]?
By answering the question in the Subject
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
__
R-help@r-project.org
ada
>
>
> > -Original Message-
> > From: jimmycl...@gmail.com
> > Sent: Fri, 4 Oct 2013 12:06:50 -0400
> > To: r-help@r-project.org
> > Subject: [R] quote a column of a dataframe by its name
> >
> > Dear All,
> >
> > I have a quest
X[,names(X)[4]] works fine for me. I had never thought of doing this. Neat
idea.
John Kane
Kingston ON Canada
> -Original Message-
> From: jimmycl...@gmail.com
> Sent: Fri, 4 Oct 2013 12:06:50 -0400
> To: r-help@r-project.org
> Subject: [R] quote a column of a datafr
Hello,
I had no problems, and it shouldn't. What exactly do you mean by "not
working"?
Hope this helps,
Rui Barradas
Em 04-10-2013 17:06, Jie escreveu:
Dear All,
I have a question, suppose X is a dataframe, with column names as
"x1", "x2", "x3", . And I would like to use the i-th colum
Sorry, this sample code seems to be OK.
I will look into my original problem and update it soon.
Best wishes,
On Fri, Oct 4, 2013 at 12:06 PM, Jie wrote:
> Dear All,
>
> I have a question, suppose X is a dataframe, with column names as
> "x1", "x2", "x3", . And I would like to use the i-th
Dear All,
I have a question, suppose X is a dataframe, with column names as
"x1", "x2", "x3", . And I would like to use the i-th column by X[,'xi'].
But it seems the single quote and double quote are different.
So if I run X[, names(X)[i]], it has some error.
Please use the below example code
7 matches
Mail list logo