{"action":"created","issue":{"url":"https://api.github.com/repos/hadley/dplyr/issues/1829","repository_url":"https://api.github.com/repos/hadley/dplyr","labels_url":"https://api.github.com/repos/hadley/dplyr/issues/1829/labels{/name}","comments_url":"https://api.github.com/repos/hadley/dplyr/issues/1829/comments","events_url":"https://api.github.com/repos/hadley/dplyr/issues/1829/events","html_url":"https://github.com/hadley/dplyr/issues/1829","id":154907686,"number":1829,"title":"dplyr bind_rows coerces inputs where data.table rbindlist does not","user":{"login":"tchakravarty","id":2289192,"avatar_url":"https://avatars.githubusercontent.com/u/2289192?v=3","gravatar_id":"","url":"https://api.github.com/users/tchakravarty","html_url":"https://github.com/tchakravarty","followers_url":"https://api.github.com/users/tchakravarty/followers","following_url":"https://api.github.com/users/tchakravarty/following{/other_user}","gists_url":"https://api.github.com/users/tchakravarty/gists{/gist_id}","starred_url":"https://api.github.com/users/tchakravarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchakravarty/subscriptions","organizations_url":"https://api.github.com/users/tchakravarty/orgs","repos_url":"https://api.github.com/users/tchakravarty/repos","events_url":"https://api.github.com/users/tchakravarty/events{/privacy}","received_events_url":"https://api.github.com/users/tchakravarty/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/hadley/dplyr/labels/reprex-needed","name":"reprex-needed","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-05-15T13:03:50Z","updated_at":"2016-05-26T14:17:59Z","closed_at":null,"body":"@hadley I am trying to call `bind_rows` on a list of `data.frame`s which have the identical set of columns with the identical attributes (or at least to the extent that `class` can tell). The columns that are getting coerced to `numeric` have the class attributes `c(\"chron\", \"date\", \"times\")`. `data.table::rbindlist` is correctly handling these types. Is there a reason for this difference and is `dplyr` doing the right thing and `data.table` is not? The latter certainly seems to have the more desirable outcome. \r\n\r\nHere is a reproducible example (apologies for the formatting of the `dput` output): \r\n```{R}\r\nli_dplyr = structure(\r\n  list(\r\n    df1 = structure(\r\n      list(\r\n        start_datetime = structure(\r\n          c(16802.0833333333, 16802.0833333333, 16802.092025463, 16802.0922337963, \r\n            16802.1046643519, 16802.1048726852, 16802.1153819444, 16802.1155902778, \r\n            16802.1261574074), \r\n          format = structure(\r\n            c(\"m/d/y\", \"h:m:s\"), \r\n            .Names = c(\"dates\", \"times\")\r\n          ), \r\n          origin = structure(\r\n            c(1, 1, 1970), \r\n            .Names = c(\r\n              \"month\", \"day\", \"year\"\r\n            )\r\n          ), \r\n          class = c(\"chron\", \"dates\", \"times\")\r\n        ), \r\n        end_datetime = structure(\r\n          c(16802.2917592593, 16802.092025463, 16802.0922337963, \r\n            16802.1046643519, 16802.1048726852,  16802.1153819444, \r\n            16802.1155902778, 16802.1261574074, 16802.1263657407), \r\n          format = structure(\r\n            c(\"m/d/y\", \"h:m:s\"),\r\n            .Names = c(\"dates\", \"times\")\r\n          ), \r\n          origin = structure(\r\n            c(1, 1, 1970),\r\n            .Names = c(\"month\", \"day\", \"year\")\r\n          ), \r\n          class = c(\"chron\", \"dates\", \"times\"))), \r\n      class = \"data.frame\", \r\n      row.names = c(NA,  -9L), \r\n      .Names = c(\"start_datetime\", \"end_datetime\")\r\n    ), \r\n    df2 = structure(\r\n      list(\r\n        start_datetime = structure(\r\n          c(16809.0833333333, 16809.0833333333, \r\n            16809.084849537, 16809.0851041667, 16809.0921180556, 16809.0922569444, \r\n            16809.1040046296, 16809.1041435185, 16809.115787037), \r\n          format = structure(\r\n            c(\"m/d/y\", \"h:m:s\"), \r\n            .Names = c(\"dates\", \"times\")\r\n          ), \r\n          origin = structure(\r\n            c(1, 1, 1970), \r\n            .Names = c(\r\n              \"month\", \"day\", \"year\"\r\n            )\r\n          ), \r\n          class = c(\"chron\", \"dates\", \"times\")\r\n        ), \r\n        end_datetime = structure(\r\n          c(16809.3751157407, \r\n            16809.084849537, 16809.0851041667, 16809.0921180556, 16809.0922569444, \r\n            16809.1040046296, 16809.1041435185, 16809.115787037, 16809.1159259259), \r\n          format = structure(\r\n            c(\"m/d/y\", \"h:m:s\"),\r\n            .Names = c(\"dates\", \"times\")\r\n          ), \r\n          origin = structure(\r\n            c(1, 1, 1970),\r\n            .Names = c(\"month\", \"day\", \"year\")\r\n          ), \r\n          class = c(\"chron\", \"dates\", \"times\"))), \r\n      class = \"data.frame\", \r\n      row.names = c(NA,  -9L), \r\n      .Names = c(\"start_datetime\", \"end_datetime\")\r\n    )\r\n  ), \r\n  .Names = c(\"df1\", \"df2\")\r\n)\r\n\r\n# original column classes                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      \r\nlapply(li_dplyr, function(x) lapply(x, class))\r\n\r\n# dplyr\r\nlapply(dplyr::bind_rows(li_dplyr), class)\r\n\r\n# data.table\r\nlapply(data.table::rbindlist(li_dplyr), class)\r\n```"},"comment":{"url":"https://api.github.com/repos/hadley/dplyr/issues/comments/221883961","html_url":"https://github.com/hadley/dplyr/issues/1829#issuecomment-221883961","issue_url":"https://api.github.com/repos/hadley/dplyr/issues/1829","id":221883961,"user":{"login":"tchakravarty","id":2289192,"avatar_url":"https://avatars.githubusercontent.com/u/2289192?v=3","gravatar_id":"","url":"https://api.github.com/users/tchakravarty","html_url":"https://github.com/tchakravarty","followers_url":"https://api.github.com/users/tchakravarty/followers","following_url":"https://api.github.com/users/tchakravarty/following{/other_user}","gists_url":"https://api.github.com/users/tchakravarty/gists{/gist_id}","starred_url":"https://api.github.com/users/tchakravarty/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchakravarty/subscriptions","organizations_url":"https://api.github.com/users/tchakravarty/orgs","repos_url":"https://api.github.com/users/tchakravarty/repos","events_url":"https://api.github.com/users/tchakravarty/events{/privacy}","received_events_url":"https://api.github.com/users/tchakravarty/received_events","type":"User","site_admin":false},"created_at":"2016-05-26T14:17:58Z","updated_at":"2016-05-26T14:17:58Z","body":"@hadley Haha. Sure thing. Now painstakingly hand-formatted for your perusal."}}
{"actor":{"display_login":"tchakravarty"}}