You should probably read some of the intro to R documents, as this is a critical component of using R.
On Wed, Dec 7, 2011 at 7:06 AM, John Visagie <john.visa...@up.ac.za> wrote: > Dear All, > > I am having a very basic error, but somehow do not know how to resolve it. > I've read a dataset in .csv into R with two columns - sector, export. When > trying to plot the data it says "sector not found" This is the formula. > > SouthAfrica<-read.csv(c,header=T) Your data frame is named SouthAfrica and it has two columns, sector and export. They can be referred to as SouthAfrica$sector and SouthAfrica$export >> hist(sector$exports,xlab="exports (MtCO2)",main="CO2 Exports") You've just told R that you want to create a histogram of the column exports from the data frame named sector, which doesn't exist. hist(SouthAfrica$exports) seems more likely to succeed. > > Error in hist(sector$exports, xlab = "exports (MtCO2)", main = "CO2 Exports") > : > object 'sector' not found > > Could somebody please assist? > > Kind regards, > > John > -- Sarah Goslee http://www.functionaldiversity.org ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.