Skip to content
Prev 366348 / 398502 Next

about data format in R

Hello,

What I did was:

DF <- read.table(text = "
date                    evap     precip    intercept
10/01/1995-00:00:00       1.5          2            0.2
10/01/1995-12:00:00       1.7          2.2         0.1
10/02/1995-00:00:00       1.5          1.8         0.3
", header = TRUE, stringsAsFactors = FALSE)

str(DF)

DF$date <- as.POSIXct(DF$date, format = "%m/%d/%Y-%H:%M:%S")
str(DF)

And it worked with no errors.

Rui Barradas

Em 30-12-2016 18:47, Sarah Goslee escreveu: