我在網上找到了一個代碼,必須(將)產生表示來自美國勞工部門的一些數據圖形:勞工統計局:GGPLOT2錯誤:對象「比」未找到
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")
但它不工作,併產生此錯誤:
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
此代碼缺少什麼?
'unemp.csv'包含來自here的數據,生成的圖形必須看起來像this。
阿圖拉,非常感謝! – Iurie