Re: [R] Adding Records to a Table in R

2017-11-08 Thread Eric Berger
gt; > > -Original Message- > > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul > Bernal > > Sent: Wednesday, November 8, 2017 2:46 PM > > To: Eric Berger > > Cc: r-help@r-project.org > > Subject: Re: [R] Adding Records to

Re: [R] Adding Records to a Table in R

2017-11-08 Thread PIKAL Petr
n...@r-project.org] On Behalf Of Paul > > Bernal > > Sent: Wednesday, November 8, 2017 2:46 PM > > To: Eric Berger > > Cc: r-help@r-project.org > > Subject: Re: [R] Adding Records to a Table in R > > > > Dear Eric, > > > > Hope you are doing

Re: [R] Adding Records to a Table in R

2017-11-08 Thread PIKAL Petr
aspects and provide correct answer. Cheers Petr > -Original Message- > From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Paul Bernal > Sent: Wednesday, November 8, 2017 2:46 PM > To: Eric Berger > Cc: r-help@r-project.org > Subject: Re: [R] Adding Recor

Re: [R] Adding Records to a Table in R

2017-11-08 Thread Paul Bernal
Dear Eric, Hope you are doing great. I also tried the following: #First I created the complete date sequence TransitDateFrame <- data.frame(TransitDate=seq(as.Date(dataset1[1,1]), as.Date(dataset1[nrow(dataset1),1]), by = "month")) #Then I did the merging dataset1NEW <- merge(TransitDateFrame

Re: [R] Adding Records to a Table in R

2017-11-08 Thread Paul Bernal
Dear Eric, thank you for your kind reply, Assume dataset1Frame is the table containing the missing dates, and TransitDateFrame <- seq(as.Date(dataset1Frame[1,1]), as.Date(dataset1Frame[nrow(dataset1Frame),1]), "months") #dataset1Frame is basically reading some fields from a SQL Server table, th

Re: [R] Adding Records to a Table in R

2017-11-01 Thread Eric Berger
Hi Paul, #First I set up some sample data since I don't have a copy of your data dtOrig <- as.Date( c("1985-04-01","1985-07-01","1985-12-01","1986-04-01")) dfOrig <- data.frame( TransitDate=dtOrig, Transits=c(100,100,500,325), CargoTons=c(1000,1080,3785,4200) ) #Generate the complete set of dates

[R] Adding Records to a Table in R

2017-11-01 Thread Paul Bernal
Dear R friends, I am currently working with time series data, and I have a table(as data frame) that has looks like this (TransitDate are in format = "%e-%B-%Y") : TransitDate Transits CargoTons 1985-04-011002500 1985-05-011354500 1985-06-01