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

Equality of POSIXct type in "i" fails #1008

Closed
davidrosenberg opened this issue Jan 14, 2015 · 1 comment
Closed

Equality of POSIXct type in "i" fails #1008

davidrosenberg opened this issue Jan 14, 2015 · 1 comment

Comments

@davidrosenberg
Copy link

I have a POSIXct column and I want to select rows for which the entry in that column equals a particular value:

a = Sys.time()
d = data.table(t = c(a, a+1))
d[t==a]

This gives the following error:

Error in UseMethod("as.data.table") : 
  no applicable method for 'as.data.table' applied to an object of class "c('POSIXct', 'POSIXt')"

I'm currently using the following workaround:

d[t>=a & t<=a]

I just got this issue after upgrading to 1.9.4 from 1.9.2 (I think).

@arunsrinivasan
Copy link
Member

Thanks. It'd be very helpful if you could also try it on development versions, in general, before filing issues.

This is a duplicate of #955 and that has been fixed (IIRC) recently with @jangorecki's as.data.table.default function. But we've not added tests yet. Will close that one after that.

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