z<-read.table("C:/yourfile.txt",header=TRUE,as.is=TRUE);
zdates<-as.POSIXct(strptime(paste(z[,2],z[,3]), "%m/%d/%Y
%H:%M:%S"),origin="1970-01-01" );
I would then convert z from a dataframe to a numeric matrix, and put zdates
in there as numeric too.
zm<-cbind(z[,1],as.numeric(zdates),z[,4])
I a
Actually I just learned something myself that you can do on the dataset
*without* the additional step in Excel.. I changed the format in
strptime to match the format (d'oh) and whala:
x
Subject Date Time Value
1 1 7/23/2003 13:05:0084
2 1 7/23/2003 13:10:0087
Hi Clay-
You may want to look at both the XTS package, in addition to 'strptime'
and 'as.POSIXct'
When I get datasets in Excel, what I normally do is change the date
(column) format to -mm-dd.. But that's due to my own shortcomings
with date formatting in R.
Here's a quick example:
>
Hi, I'm trying to learn R for a project I'm working on. I know several
programming languages, so I'm comfortable with the syntax. What I can't figure
out is how to import the file of time series data that I have and parse it into
individual series. The data was given to me in Excel, but I can o
4 matches
Mail list logo