I found a code on the web that must (will) produce a graphics representing some data from the U.S. Department of Labor: Bureau of Labor Statistics.:
library(ggplot2)
df <- as.data.frame(read.csv("unemp.csv", colClasses = c("Date", "numeric")))
p <- ggplot(df,aes(x=date,y=ratio))
p + geom_point() + geom_smooth() + xlab("Year") +
ylab("Civilian Employment Population Ratio (%)") +
labs(title="Bureau of Labor Statistics Series EMRATIO
(seasonally adjusted) to 2012-10-01")
but it do not working and produces this error:
Don't know how to automatically pick scale for object of type function. Defaulting to continuous
Error in eval(expr, envir, enclos) : object 'ratio' not found
What is missing in this code?
‘unemp.csv’ contain data from here and resulting graphics must looking like this.
The error appeared because there weren’t any variables named “date” and “ratio”. This works fine: