error: "Object not found" for column heading


I have a simple (so simple, it's embarrassing) problem. I've imported a csv file with only two columns. The column headings are clearly indicated as such, yet when I try to specify some function in the console with reference to the column heading (e.g., table(heading)), I keep getting the error "object 'column heading' not found".

I've double-checked my spelling, etc. I'm sure there is something very simple that I'm not doing, but none of the suggestions I've found through a Google search have worked and all seem to be way too complicated.

Hope to find an answer here.


This is hard to help without seeing your code but I'll try. When you imported your CSV, you probably saved it as an object. Something like

mydata <- read.csv("filename.csv")

You need to specify you want the heading from within mydata like this:


Good grief! The Internet is a wonderful thing! Steph, you saved the day! Thank you.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.