Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-10 Thread Stefano Sofia
Thank you to Arun and Petr for the give hints, veru useful. In order to get the date output in the required format, these are the commands that works: dat1$Date - as.Date(paste(dat1$Y_init, dat1$M_init, dat1$D_init, sep= ), format=%Y %m %d) dat1$Date1 - strptime(as.character(dat1$Date),

[R] format for as.Date and inserting missing rows in a data frame

2014-03-04 Thread Stefano Sofia
Dear R users, I have a very long data frame (50 years, more than 1.5 million rows) of daily rainfall data from about 80 raingouges. The data frame that I have been given looks like Raingouge_number Station_number Year Month Day Rainfall 2004 2230 1951 1 1 2.60 2004 2230 1951 1 2 0.40 2004 2230

Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-04 Thread arun
Hi, May be this helps: dat - read.table(text=Raingouge_number Station_number Year Month Day Rainfall 2004 2230 1951 1 1 2.60 2004 2230 1951 1 2 0.40 2004 2230 1951 1 3 0.00 2004 2230 1951 1 4 0.00 2004 2230 1951 1 5 0.20 2004 2230 1951 1 6 0.00 2004 2230 1951 1 7 0.00 2004 2230 1951 1 9 0.00 2004

Re: [R] format for as.Date and inserting missing rows in a data frame

2014-03-04 Thread PIKAL Petr
Hi -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-bounces@r- project.org] On Behalf Of Stefano Sofia Sent: Tuesday, March 04, 2014 11:58 AM To: r-help@r-project.org Subject: [R] format for as.Date and inserting missing rows in a data frame Dear R users, I