Create a Time Series from a CSV file
You can use the zoo
package. The code below was writen to be reproducible but in actual practice text="Lines"
would be replaced with file="fileName"
. Also as shown in the question the Date field is ambiguous and you may need to adjust the percent codes if its not day/month/year.
library(zoo)
Lines <- "Date,Time,Value
04/01/2010,07:10,17159
04/01/2010,07:20,4877
04/01/2010,07:30,6078
04/01/2010,07:40,3105
"
z <- read.zoo(text = Lines, sep = ",", header = TRUE,
index = 1:2, tz = "", format = "%d/%m/%Y %H:%M")
which gives:
> z
2010-01-04 07:10:00 2010-01-04 07:20:00 2010-01-04 07:30:00 2010-01-04 07:40:00
17159 4877 6078 3105