所以我知道這是常見的問題,但我發現似乎沒有任何工作。我遇到的問題是R一直在聲明該對象沒有找到,即使我知道它在那裏,因爲它列出了df的名稱。找不到對象和RStudio
到目前爲止,我已經運行的代碼是:
setwd("C:\\Users\\fredd\\Dropbox\\Grad_Life\\Spring_2017\\AFM\\Final_Paper\\")
KWTProd.df = read.csv("Merge1//Kwht_Production_07-15.csv", header=T)
names(KWTProd.df)
plot(Period_kWh_Production$Production.Period.End.Date)
和控制檯顯示此:
> setwd("C:\\Users\\fredd\\Dropbox\\Grad_Life\\Spring_2017\\AFM\\Final_Paper\\")
>
> KWTProd.df = read.csv("Merge1//Kwht_Production_07-15.csv", header=T)
>
> names(KWTProd.df)
[1] "Application.Number" "Program.Administrator" "Program"
[4] "Total.Cost" "System.Owner.Sector" "Host.Customer.Sector"
[7] "Host.Customer.Physical.Address.City" "Host.Customer.Physical.Address.County" "Host.Customer.Physical.Address.Zip.Code"
[10] "PBI.Payment.." "Production.Period.End.Date" "Period_kWh_Production"
>
> plot(Period_kWh_Production$Production.Period.End.Date)
Error in plot(Period_kWh_Production$Production.Period.End.Date) :
object 'Period_kWh_Production' not found
在R中你需要「\\」或「/」。嘗試改變爲:'setwd(「C:\\ Users \\ fredd \\ Dropbox \\ Grad_Life \\ Spring_2017 \\ AFM \\ Final_Paper \\」)' – TheBiro
不應該是'KWTProd.df $生產'plot'語句中的.Period.End.Date'? –