Skip to content
Prev 138345 / 398506 Next

write csv file from zoo object

# chron
library(chron)
fmt.chron <- function(x) {
   chron(sub(" .*", "", x), gsub(".* (.*)", "\\1:00", x))
}
z1 <- read.zoo(SC3.csv, sep = ",", header = TRUE, FUN = fmt.chron)
z2 <- read.zoo(SC2.csv, sep = ",", header = TRUE, FUN = fmt.chron)

z3<-c(z1, z2)

write.table(z3, sep="," , "SC.csv")

How do you include the datetime column in the output file