[R] readcsvIts() to create irregular time series
Heywood, Giles
Giles.Heywood at CommerzbankIB.com
Mon Sep 1 16:43:50 CEST 2003
Jan
The function readcsvIts reads a csv file into a matrix. To convert
the matrix into an 'its', apply the its function to the matrix.
So for your example
its.format("%m/%d/%Y")
test <- its(readcsvIts(filename))
is.its(test)
"TRUE"
The its documentation for readcsvIts states incorrectly that an 'its'
object is returned, so your confusion is understandable. I will correct
this in the next release.
Giles
> -----Original Message-----
> From: Jan Verbesselt [mailto:Jan.Verbesselt at agr.kuleuven.ac.be]
> Sent: 01 September 2003 15:00
> To: r-help at stat.math.ethz.ch
> Subject: [R] readcsvIts() to create irregular time series
>
>
> Dear,
>
> Thanks for the previous tips about 'its' for importing the following
> data.
> 5/10/1998,7
> 5/11/1998,5
> 5/12/1998,2
> 5/14/1998,1
> 5/15/1998,1
> 5/19/1998,1
> 5/20/1998,1
>
> 1. When using the following command;
> test<-readcsvIts('Fires98.csv',informat=its.format("%m/%d/%Y")
> ,header=FA
> LSE)
>
> the function reads in the data from the csv file as;
> V2
> 05/10/1998 7
> 05/11/1998 5
>
> When testing if it's a its object
> is.its(test)
> the result is FALSE.
> When do you use informat or outformat?
> What goes wrong?
>
> 2. When reading in the data as a table;
> m1 <- read.table('Fires98.csv',header=FALSE, sep=",", dec=".")
> V1 V2
> 1 5/10/1998 7
> 2 5/11/1998 5
> ...
> test2 <- its(m1,dates=as.POSIXct(x=strptime(dimnames(V1)[[1]]
> format=its.format("%m/%d/%Y"))) )...Doesn't work!
>
> I have difficulties defining the first V1 column as its object.
>
> Thanks in advance for helping me out,
> Jan
>
>
>
> ______________________________________________________________
> __________
> __
> Jan Verbesselt
> Research Associate
> Lab of Geomatics and Forest Engineering K.U. Leuven
> Vital Decosterstraat 102. B-3000 Leuven Belgium
> Tel:+32-16-329750
> Fax: +32-16-329760
> http://perswww.kuleuven.ac.be/~u0027178/VCard/mycard.php?name=janv
> http://gloveg.kuleuven.ac.be/
> ______________________________________________________________
> __________
> __
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>
**********************************************************************
This is a commercial communication from Commerzbank AG.\ \ T...{{dropped}}
More information about the R-help
mailing list