我一直收到此错误,但无法弄清楚我的来源有什么问题。
Error in source("/Users/oscarbaker/Documents/Dissertation/R/Moisture_Monthly.Rd") :
/Users/oscarbaker/Documents/Dissertation/R/Moisture_Monthly.Rd:41:1: unexpected symbol
40:
41: matplot
^
这是我的大部分资料来源:
Moisture_Names = c("DIM","MONTH","YEAR","Hour","Mins","DOY","TMN_2","TMN_5","TMN_10","TMN_30","TMN_50","TMN_65","TMS_2","TMS_5","TMS_10","TMS_20","TMS_40","TMS_60","TMW_2","TMW_5","TMW_10","TMW_20","TMW_40","TMW_60","TMW_80","TMW_100","TPN_8","TPN_20","TPN_40","TPN_65","CS616S_L8","CS616S_L20","CS616S_L40","CS616S_L68","CS616S_Q8","CS616S_Q20","CS616S_Q40","CS616S_Q68")
file2012 <- read.csv("/Users/oscarbaker/Documents/Dissertation/Datasets/Soil_Moisture_12.csv", header=T", sep=",", col.names=Moisture_Names)
file2013 <- read.csv("/Users/oscarbaker/Documents/Dissertation/Datasets/Soil_Moisture_13.csv", header="T", sep=",", col.names=Moisture_Names)
#Jan
matplot(Jan2012$DOY,Jan2012$TMN_2, type="l", lty="1", col="1", xlim=c(0,32), ylim=c(0,70), xlab="Day Number", ylab="Moisture Content")
points(Jan2012$DOY,Jan2012$TMN_5, type="l", lty="2", col="1")
某处肯定有错,但我看不到它
答案 0 :(得分:3)
代码SO的精彩代码格式化可以立即显示您的错误。
这一行:
file2012 <- read.csv("/Users/oscarbaker/Documents/Dissertation/Datasets/Soil_Moisture_12.csv", header=T", sep=",", col.names=Moisture_Names)
(由cgw编辑)
你错过了一个引用,它应该是header = TRUE。请勿在{{1}}值logical
或TRUE
周围加上引号。习惯使用“TRUE”而不是“T”也很重要 - 只要问遗传学家: - )