{"action":"created","issue":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/654","repository_url":"https://api.github.com/repos/Rdatatable/data.table","labels_url":"https://api.github.com/repos/Rdatatable/data.table/issues/654/labels{/name}","comments_url":"https://api.github.com/repos/Rdatatable/data.table/issues/654/comments","events_url":"https://api.github.com/repos/Rdatatable/data.table/issues/654/events","html_url":"https://github.com/Rdatatable/data.table/issues/654","id":35236403,"number":654,"title":"[R-Forge #1668] Improve cryptic error message for by=year(POSIX)","user":{"login":"arunsrinivasan","id":3102045,"avatar_url":"https://avatars.githubusercontent.com/u/3102045?v=3","gravatar_id":"","url":"https://api.github.com/users/arunsrinivasan","html_url":"https://github.com/arunsrinivasan","followers_url":"https://api.github.com/users/arunsrinivasan/followers","following_url":"https://api.github.com/users/arunsrinivasan/following{/other_user}","gists_url":"https://api.github.com/users/arunsrinivasan/gists{/gist_id}","starred_url":"https://api.github.com/users/arunsrinivasan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunsrinivasan/subscriptions","organizations_url":"https://api.github.com/users/arunsrinivasan/orgs","repos_url":"https://api.github.com/users/arunsrinivasan/repos","events_url":"https://api.github.com/users/arunsrinivasan/events{/privacy}","received_events_url":"https://api.github.com/users/arunsrinivasan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Rdatatable/data.table/labels/feature%20request","name":"feature request","color":"009800"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/Rdatatable/data.table/milestones/4","html_url":"https://github.com/Rdatatable/data.table/milestones/v2.0.0","labels_url":"https://api.github.com/repos/Rdatatable/data.table/milestones/4/labels","id":843942,"number":4,"title":"v2.0.0","description":"","creator":{"login":"arunsrinivasan","id":3102045,"avatar_url":"https://avatars.githubusercontent.com/u/3102045?v=3","gravatar_id":"","url":"https://api.github.com/users/arunsrinivasan","html_url":"https://github.com/arunsrinivasan","followers_url":"https://api.github.com/users/arunsrinivasan/followers","following_url":"https://api.github.com/users/arunsrinivasan/following{/other_user}","gists_url":"https://api.github.com/users/arunsrinivasan/gists{/gist_id}","starred_url":"https://api.github.com/users/arunsrinivasan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunsrinivasan/subscriptions","organizations_url":"https://api.github.com/users/arunsrinivasan/orgs","repos_url":"https://api.github.com/users/arunsrinivasan/repos","events_url":"https://api.github.com/users/arunsrinivasan/events{/privacy}","received_events_url":"https://api.github.com/users/arunsrinivasan/received_events","type":"User","site_admin":false},"open_issues":68,"closed_issues":7,"state":"open","created_at":"2014-10-28T16:55:41Z","updated_at":"2016-07-20T20:32:05Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2014-06-08T13:17:10Z","updated_at":"2016-07-20T20:32:05Z","closed_at":"2016-07-20T20:32:05Z","body":"Submitted by: Matt Dowle; Assigned to: Nobody; [R-Forge link](https://r-forge.r-project.org/tracker/index.php?func=detail&aid=1668&group_id=240&atid=978)\r\n\nAs observed here :\r\n\r\nhttp://stackoverflow.com/questions/8220429/can-data-table-functions-manipulate-date-and-time-columns-on-the-fly\r\n\r\nAlso bring the ?IDateTime by syntax up to date using by=list().\r\n"},"comment":{"url":"https://api.github.com/repos/Rdatatable/data.table/issues/comments/234072957","html_url":"https://github.com/Rdatatable/data.table/issues/654#issuecomment-234072957","issue_url":"https://api.github.com/repos/Rdatatable/data.table/issues/654","id":234072957,"user":{"login":"arunsrinivasan","id":3102045,"avatar_url":"https://avatars.githubusercontent.com/u/3102045?v=3","gravatar_id":"","url":"https://api.github.com/users/arunsrinivasan","html_url":"https://github.com/arunsrinivasan","followers_url":"https://api.github.com/users/arunsrinivasan/followers","following_url":"https://api.github.com/users/arunsrinivasan/following{/other_user}","gists_url":"https://api.github.com/users/arunsrinivasan/gists{/gist_id}","starred_url":"https://api.github.com/users/arunsrinivasan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arunsrinivasan/subscriptions","organizations_url":"https://api.github.com/users/arunsrinivasan/orgs","repos_url":"https://api.github.com/users/arunsrinivasan/repos","events_url":"https://api.github.com/users/arunsrinivasan/events{/privacy}","received_events_url":"https://api.github.com/users/arunsrinivasan/received_events","type":"User","site_admin":false},"created_at":"2016-07-20T20:32:05Z","updated_at":"2016-07-20T20:32:05Z","body":"This seems to work just fine now...\r\n\r\n```r\r\nrequire(data.table) # v1.9.7+\r\ndt = data.table(x=1:5, y=as.Date(17000:17001, origin=\"1970-01-01\"))[, z := as.POSIXct(y)]\r\n#    x          y                   z\r\n# 1: 1 2016-07-18 2016-07-18 02:00:00\r\n# 2: 2 2016-07-19 2016-07-19 02:00:00\r\n# 3: 3 2016-07-18 2016-07-18 02:00:00\r\n# 4: 4 2016-07-19 2016-07-19 02:00:00\r\n# 5: 5 2016-07-18 2016-07-18 02:00:00\r\n\r\ndt[, .N, by=wday(y)]\r\n#    wday N\r\n# 1:    2 3\r\n# 2:    3 2\r\n\r\ndt[, .N, by=wday(z)]\r\n#    wday N\r\n# 1:    2 3\r\n# 2:    3 2\r\n```"}}
{"actor":{"display_login":"arunsrinivasan"}}