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

[Request] Warn when as.data.table encounters POSIXct/POSIXlt #1289

Closed
TimeLordmbw opened this issue Aug 25, 2015 · 2 comments
Closed

[Request] Warn when as.data.table encounters POSIXct/POSIXlt #1289

TimeLordmbw opened this issue Aug 25, 2015 · 2 comments

Comments

@TimeLordmbw
Copy link

A warning generated by as.data.table upon encountering POSIXlt formatting would have saved me several minutes. A FAQ entry relating to this might be useful to some, as well.

Background: I recently converted a data frame containing a date/time column to a data table (using as.data.table) in order to generate a grouped mean. The data frame silently converts, but then when trying to generate the means (using DT[, lapply(.SD,mean), "Key_column"]), I get the dreaded (by me) error "GForce mean can only be applied to columns, not .SD or similar." After narrowing down the problem to a single column, I find that manipulating it yields the fairly cryptic (to me) warning: "In is.na(secs) : is.na() applied to non-(list or vector) of type 'NULL'". Once I figured it out (via stackoverflow), it isn't too difficult to work around, it just took a little while to find the problem.

@arunsrinivasan
Copy link
Member

Duplicate of #646. We haven't gotten to it yet. I'd be glad to review PRs.

@arunsrinivasan
Copy link
Member

#646 is fixed now.. POSIXlt columns when present returns a warning followed by conversion to POSIXct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants