Re: [R] FW: getting time series into r

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Mon, 23 May 2011 17:16:46 -0400

On May 23, 2011, at 4:31 PM, Ben Bolker wrote:

> Heiman, Thomas J. <theiman <at> mitre.org> writes:
>
>> tmp <- read.table("baltimore.csv", sep = " ") ##This is timeseries 2
>> z <- zoo(tmp[, 2:20], as.Date(as.character(tmp[, 1]), format = ))

In this file you have no separators in the dates so the format would be "%Y%m%d". It's also not a csv file .... no commas

>>
>> tmp1 <- read.table("baltimorefludata.csv", sep = " ") ##This is
>> timeseries 1
>> z2 <- zoo(tmp[,2], as.Date(tmp[, 1]), format = ))

For this one the format would be "%m/%d/%Y". There also appeared to be no whitespace after some of the entries, so you might need utils::read.fwf()

>>
>
>
> I think you need format="%m/%d/%Y"
>
> ______________________________________________
> R-help_at_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.

David Winsemius, MD
West Hartford, CT



R-help_at_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. Received on Mon 23 May 2011 - 21:19:43 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 23 May 2011 - 21:40:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive