Hi,
I am trying to get the following two timeseries (these are small subsets of the
whole thing) into R so I can merge them using zoo.
Timeseries 1=[
Date Count
9/28/2003
1505
10/5/2003
1535
10/12/2003
1549
10/19/2003
1466
10/26/2003
1460
11/2/2003
1501
11/9/2003
1456
11/16/2003
1806
11/23/2003
2466
11/30/2003
4309
12/7/2003
7490]
Timeseries2=[
YEARMODA
TEMP
DEWP
SLP
STP
FRSHTT
20030928
68
24
58.6
24
1008
24
1002.5
24
110010
20030929
57.7
24
47.7
24
1014
24
1008.4
24
10000
20030930
53.7
24
42
24
1023.7
24
1018
24
0
20031001
54.7
24
45.7
24
1022.3
24
1016.5
23
10000
20031002
52
24
37.4
24
1019.8
24
1014.1
24
0
20031003
49
24
32.5
24
1022.5
24
1016.7
24
100000
20031004
53.3
24
43.6
24
1012.6
24
1006.9
24
10000
20031005
54.6
24
40.2
24
1015.4
24
1009.7
24
0
20031006
56.6
24
42.4
24
1018.9
24
1013.2
24
0
20031007
58.4
24
45.3
24
1021.7
24
1016.1
24
0
]
tmp <- read.table("baltimore.csv", sep = ",") ##This is
timeseries 2
z <- zoo(tmp[, 2:9], as.Date(as.character(tmp[, 1]), format = "%d %b
%Y"))
tmp1 <- read.table("baltimorefludata.csv", sep =
",")##This is timeseries 1
z2 <- zoo(tmp[,2], as.Date(tmp[, 1]), format = "%d %b %Y"))
R is not recognizing Date or YEARMODA as dates..Any suggestions on what I am
doing wrong or how to fix it would be greatly appreciated!!!
Sincerely,
tom
Thomas Heiman, PhD
Info Systems Eng, Sr
The MITRE Corporation | Center for Enterprise Modernization
Office: 703-983-2951 | theiman@mitre.org<mailto:theiman@mitre.org>
[[alternative HTML version deleted]]
On Mon, May 23, 2011 at 1:30 PM, Heiman, Thomas J. <theiman at mitre.org> wrote:> Hi, > > I am trying to get the following two timeseries (these are small subsets of the whole thing) into R so I can merge them using zoo. >The email may have messed up your data. Try attaching it to your post as a .txt file. It may be that you can figure it out yourself by reading ?read.zoo and the following document which has many read.zoo examples: https://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/zoo/inst/doc/zoo-read.Rnw?revision=847&root=zoo -- Statistics & Software Consulting GKX Group, GKX Associates Inc. tel: 1-877-GKX-GROUP email: ggrothendieck at gmail.com
Hi,
I am trying to get the attached following two timeseries (these are small
subsets of the whole thing) into R so I can merge them using zoo.
tmp <- read.table("baltimore.csv", sep = ",") ##This is
timeseries 2
z <- zoo(tmp[, 2:20], as.Date(as.character(tmp[, 1]), format = "%y %m
%d"))
tmp1 <- read.table("baltimorefludata.csv", sep = ",")
##This is timeseries 1
z2 <- zoo(tmp[,2], as.Date(tmp[, 1]), format = "%m %d %y"))
R is not recognizing Date or YEARMODA as dates..Any suggestions on what I am
doing wrong or how to fix it would be greatly appreciated!!!
Sincerely,
tom
Thomas Heiman, PhD
Info Systems Eng, Sr
The MITRE Corporation | Center for Enterprise Modernization
Office: 703-983-2951 | theiman at mitre.org<mailto:theiman at mitre.org>
[[alternative HTML version deleted]]
______________________________________________
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.
Hi David, I have attached them to this note as .txt files.. Sorry about that.. Sincerely, tom Thomas Heiman, PhD Info Systems Eng, Sr The MITRE Corporation | Center for Enterprise Modernization Office: 703-983-2951 | theiman at mitre.org -----Original Message----- From: David Winsemius [mailto:dwinsemius at comcast.net] Sent: Monday, May 23, 2011 3:49 PM To: Heiman, Thomas J. Cc: R-help at r-project.org Subject: Re: [R] getting time series into r On May 23, 2011, at 2:32 PM, Heiman, Thomas J. wrote:> > Hi, > > I am trying to get the attached following two timeseriesNothing attached. The mail-server refuses files with csv extension but would have accepted them with .txt extension. It's just a dumb machine, after all. -- David.> (these are small subsets of the whole thing) into R so I can merge > them using zoo. > > tmp <- read.table("baltimore.csv", sep = " ") ##This is timeseries 2 > z <- zoo(tmp[, 2:20], as.Date(as.character(tmp[, 1]), format = "%y > %m %d")) > > tmp1 <- read.table("baltimorefludata.csv", sep = " ") ##This is > timeseries 1 > z2 <- zoo(tmp[,2], as.Date(tmp[, 1]), format = "%m %d %y")) > > R is not recognizing Date or YEARMODA as dates..Any suggestions on > what I am doing wrong or how to fix it would be greatly appreciated!!! > > Sincerely, > > tom > > > > > > > > > Thomas Heiman, PhD > Info Systems Eng, Sr > The MITRE Corporation | Center for Enterprise Modernization > Office: 703-983-2951 | theiman at mitre.org<mailto:theiman at mitre.org> > > [[alternative HTML version deleted]] > > ______________________________________________ > 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. > ______________________________________________ > 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