r - as.Date converts wrong date from POSIXct data -


i have 3848 rows of posixct data - stop times of bike trips in month of april. can see, of data in posixct format , within range of month of april.

length(output2_stoptime) [1] 3848 head(output2_stoptime) [1] "2015-04-01 17:19:27 est" "2015-04-02 07:26:06 est" "2015-04-08      10:09:37 est" [4] "2015-04-12 20:08:00 est" "2015-04-13 17:53:11 est" "2015-04-14    07:17:34 est" class(output2_stoptime) [1] "posixct" "posixt" range(output2_stoptime) [1] "2015-04-01 00:34:29 est" "2015-04-30 20:49:22 est" sys.timezone() [1] "est"  

however, when try converting table of stop times per day, 4 dates converted 1st of may. thought might occurring due different system timezone located in europe @ moment, after setting timezone est, problem persists. example:

by_day_output2 = as.data.frame(as.date(output2_stoptime), tz = "est") colnames(by_day_output2)[1] = "sum"  movements_apr = as.data.frame(table(by_day_output2$sum)) colnames(movements_apr)[1] = "date"  tail(movements_apr)          date freq 26 2015-04-26   96 27 2015-04-27  125 28 2015-04-28  145 29 2015-04-29  151 30 2015-04-30   99  31 2015-05-01    4  

why 4 dates converting improperly when time zones of data , system match? none of data falls within may.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -