Skip to content

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

Description

@jcwild12

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions