r - Time series is throwing up error message -
i trying conduct time series analysis based on dataset:
time point_y point_x 00:00 106.78 207.44 00:30 106.61 207.6 01:00 103.72 208.33 01:30 102.57 207.35 02:00 102.27 206.3 02:30 101.6 206.43 03:00 100.66 206.73 03:30 101.11 206.5 04:00 100.95 206.63 04:30 102.02 206.27 05:00 105.83 207.93 05:30 106.98 207.15 06:00 107.32 206.28 06:30 108.36 204.7 07:00 107.97 203.41 07:30 107.76 202.63 08:00 107.85 201.13 08:30 107.6 198.74 it has been set as:
austriacus<-read.table("austriacus.txt",header=t). the time series function: x.ts<-ts(point_x,time) not working , producing following error message: error in is.data.frame(data) : object 'point_x' not found
any ideas on this?
try zoo , chron packages:
lines <- "time point_y point_x 00:00 106.78 207.44 00:30 106.61 207.6 01:00 103.72 208.33 01:30 102.57 207.35 02:00 102.27 206.3 02:30 101.6 206.43 03:00 100.66 206.73 03:30 101.11 206.5 04:00 100.95 206.63 04:30 102.02 206.27 05:00 105.83 207.93 05:30 106.98 207.15 06:00 107.32 206.28 06:30 108.36 204.7 07:00 107.97 203.41 07:30 107.76 202.63 08:00 107.85 201.13 08:30 107.6 198.74 " library(zoo) library(chron) to.times <- function(x) times(paste0(x, ":00")) # z <- read.zoo("myfile", header = true, fun = to.times) z <- read.zoo(text = lines, header = true, fun = to.times) plot(z)
Comments
Post a Comment