[R] Getting unexpected extra rows (continued)

Paul Bernal paulbernal07 at gmail.com
Thu Mar 30 23:31:22 CEST 2017


Hello everyone,

So I have  created a date sequence with the following code:

>x<-seq(as.Date("1985-10-01"), as.Date(Sys.Date()), "months")

>x["Transits"]<-NA

>xFrame<-data.frame(x)


> str(xFrame)

'data.frame':   379 obs. of  1 variable:
 $ x: Date, format: "1985-10-01" "1985-11-01" "1985-12-01" "1986-01-01" ...

How can I make this a dataframe with two columns (date and transits) and
378 observations with value NA?

Any help will be greatly appreciated,

Regards,

Paul

	[[alternative HTML version deleted]]



More information about the R-help mailing list