> I am taking an excel dataset and reading it into R using read.table. > (actually I am dumping the data into a .txt file first and then reading data > in to R).
If you are on *windows* you could also try my xlsReadWrite package which contains some datetime functions. Exceldates (e.g. formatted as dd-mmm-yy) can be read as COleDateTime (floating point) values or as character strings. The first one is preferable imo as it avoids a typecast and it is the type commonly used in OLE automation. > But how can I subset for multiple periods e.g 00- 05? Floating point numbers dates can be converted to year-strings with dateTimeToStr( value, "yy" ) and then subset as shown in a previous post. The (paid) pro version contains many more date functions, e.g. yearOf. Details see http://treetron.googlepages.com/xls.oledatetimeex.html. -- Regards, Hans-Peter ______________________________________________ R-help@stat.math.ethz.ch 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.