Dear all, Is there a simple trick to read in data with the following format and create a Time Serie object of it? Date CountOfField2 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 5/21/1998 1 5/24/1998 2 5/25/1998 1 5/26/1998 2 .... 2002 ... R should recognize that some dates are not available...(NA). You can define start and end date Ok, and frequency= 365 is ok...but is it possible that recognizes the gaps? Thanks a lot, 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/ ________________________________________________________________________ __
Objects of class ts are for regualrly spaced time series only. What you have is an irregular time series. On Thu, 21 Aug 2003, Jan Verbesselt wrote:> Dear all, > > Is there a simple trick to read in data with the following format and > create a Time Serie object of it? > > Date CountOfField2 > 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 > 5/21/1998 1 > 5/24/1998 2 > 5/25/1998 1 > 5/26/1998 2 > .... > 2002 > ...And what does `2002' mean here?> R should recognize that some dates are not available...(NA). You can > define start and end date Ok, and frequency= 365 is ok...but is it > possible that recognizes the gaps?R does what you program it to do, and you could instruct it to do this. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
You might wish to have a look at the package 'its' for handling irregular time-series. If your data is in a .csv file, the following would enable you to handle the data in its irregular form. its.format("%m/%d/%Y") readcsvIts(filename) - Giles> -----Original Message----- > From: Jan Verbesselt [mailto:Jan.Verbesselt at agr.kuleuven.ac.be] > Sent: 21 August 2003 15:07 > To: r-help at stat.math.ethz.ch > Subject: [R] Read date for timeserie object > Importance: High > > > Dear all, > > Is there a simple trick to read in data with the following format and > create a Time Serie object of it? > > Date CountOfField2 > 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 > 5/21/1998 1 > 5/24/1998 2 > 5/25/1998 1 > 5/26/1998 2 > .... > 2002 > ... > > R should recognize that some dates are not available...(NA). You can > define start and end date Ok, and frequency= 365 is ok...but is it > possible that recognizes the gaps? > > Thanks a lot, > 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}}