0

dataflair_rng['date'] = pd.date_range('2021-12-01 12:00:00', periods = 50, freq ='H')

this syntax will give me next 50 points from 2021-12-01 12:00:00

can we do that in R ??

if yes then How ? (I used plyr but it just resample the data )

jony
  • 924
  • 10
  • 25

1 Answers1

1

Try this

library("chron")
date_dataflair <- seq.dates("01/12/2021", by = "day", length = 50)

For Date time

seq(from = as.POSIXct("2021-12-01", tz = "GMT"), 
length.out = 50, 
by = "days")
Shubh
  • 585
  • 9
  • 29
  • Thanks , i saw this , but what about hour frequency – jony Sep 05 '19 at 06:39
  • If this is your desired answer please vote – Shubh Sep 05 '19 at 07:14
  • ill do vote , but concern is , hourly means day single (24 hours on that day) , Like -: `"24-01-21 06:00:00"` `"24-01-21 07:00:00"` and more – jony Sep 05 '19 at 07:54
  • is there any way to remove `GMT` ??? if i don't write anything there it will come up with `IST` .. i don't want anything there .. how to do that?? – jony Sep 05 '19 at 08:49