Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bind_rows with POSIXt columns generated by seq.POSIXt #1402

erikriverson opened this issue Sep 10, 2015 · 1 comment

bind_rows with POSIXt columns generated by seq.POSIXt #1402

erikriverson opened this issue Sep 10, 2015 · 1 comment


Copy link

Not sure if this is the intended behavior of bind_rows or not, but I wanted to put it down in case anyone else runs across this behavior. This example is using version 0.4.3.

now <- Sys.time()

df1 <- data.frame(time = now)
class(df1$time) # [1] "POSIXct" "POSIXt" 
typeof(df1$time) # [1] "double"
class(bind_rows(df1)$time) # [1] "POSIXct" "POSIXt" 

df2 <- data.frame(time = seq(now, length.out = 1, by = 1))
class(df2$time) # [1] "POSIXct" "POSIXt" 
typeof(df2$time) # [1] "integer"
class(bind_rows(df2)$time) # [1] "integer"

As another way of seeing the difference between df1 and df2, compare dput(df1) and dput(df2) The class(es) of the objects are identical, but the underlying storage type is not, which leads to a difference in behavior when bind_rows is called.

Copy link

Hmm. I did not know R could generate POSIXct vectors with underlying integer representation.

@romainfrancois romainfrancois self-assigned this Sep 13, 2015
@romainfrancois romainfrancois added this to the 0.5 milestone Sep 13, 2015
@lock lock bot locked as resolved and limited conversation to collaborators Jun 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet
None yet

No branches or pull requests

2 participants