Skip to content
Prev 4638 / 15274 Next

Read timeseries from csv file with xts or quantmod

Try this:

Lines <- "1948-01-01 51,7
1948-02-01 50,2
1948-03-01 43,3
1948-04-01 45,4
1948-05-01 49,5
1948-06-01 53
1948-07-01 48,4
1948-08-01 45,1
1948-09-01 42,1
1948-10-01 47,2
1948-11-01 42,4
1948-12-01 35
1949-01-01 32,9
1949-02-01 31,3
1949-03-01 34,5
1949-04-01 35,5
1949-05-01 32,6
1949-06-01 31,6"
library(xts)
# z <- read.zoo("myfile.txt", dec = ",")
z <- read.zoo(textConnection(Lines), dec = ",")
x <- as.xts(z)
On Fri, Jul 24, 2009 at 10:41 AM, Mark Breman<breman.mark at gmail.com> wrote: