'closure'类型的对象不是子集

时间:2014-10-30 12:41:16

标签: r

这是我的代码。我的目标是制作一个ccf并绘制图表。

# Read from Excel worksheet
# library(xlsx)
# mydata <- read.xlsx("c:/myexcel.xlsx", 1)

# read in the worksheet named mysheet
# mydata <- read.xlsx("c:/myexcel.xlsx", sheetName = "mysheet") 

data <- read.table("BLKP.txt",dec = ",")
names(BLKP) <- c("day","hour","temp","cond")
day <- data$day
hour <- data$hour
temp <- data$temp
cond <- data$cond
time <- paste(day,hour)
time <- as.POSIXct(time)
# time <- as.Date(time,format='%d/%m/%Y %H:%M')
time <- as.POSIXct(strptime(paste(day,hour),'%d/%m/%Y %H:%M'))
plot(time,temp)
plot(time,cond)
# par(new=TRUE) overlay plots
ccf(temp,cond)

当我到达day<- data$day时会出现错误消息&#34;数据错误$ day:类型为&#39;关闭的对象&#39;不是子集表格&#34;。

请帮帮我

0 个答案:

没有答案