Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in [.data.frame(col, i) : undefined columns selected #287

Open
jcwild12 opened this issue Nov 7, 2017 · 1 comment
Open

Error in [.data.frame(col, i) : undefined columns selected #287

jcwild12 opened this issue Nov 7, 2017 · 1 comment

Comments

@jcwild12
Copy link

jcwild12 commented Nov 7, 2017

Hello everyone,

I am new to GitHub, this is my first post. I'm using R x64 3.4.1 on Windows 10 and trying to run the function ddply in the plyr package. I've attached a screenshot of some code as I can't share the data: I'm working with a large dataframe and so I've created a smaller dataframe to illustrate the issue. I've created "lm" with 40 obs and 4 variables, three variables I'm interested in and one I'm not ("blah"). I produce the names of the variables in the dataframe and then run ddply to get the mean based on "CAsNum" and "tAsNum" with the condition that the values of "qAsNum" are between 1 and 5. Works great.

When I try to do the same with another dataframe, "fullData," I get the error cited in the title. But before I produce the error, I show the names of the variables in "fullData" to show that the three variables of interest have the same name (of note, they are of class "numeric"), and then I table each to show there are no "NA" in these variables. I've looked at many, many postings online but found no fix for this issue. Any advice would be welcome.

Justin
console

@OneMoreUserOverhere
Copy link

Hey Justin,
I think one year of waiting is enough now:
The Problem might be a missing "," in your last coderow in the screenshot.
So instead of "mean(.......[... & qAsNum<=5]))", it has to be "mean(.......[... & qAsNum<=5 , ]))"

Over and out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants