Hello, Attached is the file created from as.xts. After submitting the following code, I got an error. Please help. Thanks. diveCond <- data.frame(matrix(0, nrow=61, ncol=17)) names(diveCond) <- c("dive_id", "timestamp", "visability", "r_wvht", "r_dpd", "r_apt", "r_mwd", "r_wtmp", "l_salinity", "l_o2", "l_hs", "l_tp", "l_wdir", "l_along", "l_cross", "l_mab", "l_depth") dive_id <- 0 for(i in unique(as.character(index(diveData_2008)))){ dive_id <- dive_id+1 diveCond$dive_id[dive_id] <- dive_id diveCond$timestamp[dive_id] <- as.character(i) diveCond$visability[dive_id] <- as.numeric(diveData_2008[i][1,11])
} Error in if (length(c(year, month, day, hour, min, sec)) == 6 && c(year, : missing value where TRUE/FALSE needed In addition: Warning messages: 1: In as_numeric(YYYY) : NAs introduced by coercion 2: In as_numeric(YYYY) : NAs introduced by coercion Thanks, Yolande
______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.