-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
arrange converts class Period
to num
#266
Comments
I suppose it only uses the |
@romainfrancois for now I think we should have a whitelist of column types (logical, integer, double, character, factor, ordered factor, Date, POSIXct). That would also resolve #266 |
The problem here is that
I could black list things that have the S4 bit set so that we'd have the list above expect when the object is an S4 object. This is an unfortunate consequence of the design of the |
This is an unfortunate design of S3/S4 in general - I think you need to do something like |
This might be too restrictive. Here is a snippet from do_isvector: https://github.com/wch/r-source/blob/013f4896e0946d638e96fe0a736b53a5d8e6063f/src/main/coerce.c#L1962
In essence it means that only |
Here is a start. https://github.com/hadley/dplyr/blob/master/inst/include/dplyr/white_list.h |
Now failing like this:
I need to check other places where it makes sense to use |
Hmm. Are list ( Perhaps I should black list |
I don't think you need to blacklist |
Hmm.
So we'd let a
|
Hmm. see Rcpp11/Rcpp11#112 (and RcppCore/Rcpp#120)
|
Ok, you've convinced me - let's blacklist |
Done. Closing the issue now as the problem is fixed. |
You can create with e.g. |
Sure, I meant creating |
Oh sure - just create a minimal class in the test: Period <- setClass("Period", contains = "numeric")
p <- Period(c(1, 2, 3)) |
Ah. yes. Thanks. Done now. |
@romainfrancois , If you blacklist |
@bartev Correct, because you should never put a POSIXlt object in a data frame. Basically they're uniformally inferior to POXIct. |
When using
arrange
, thePeriod
type data gets converted to typenum
.Here's an example of some code and output comparing dplyr and plyr.
The text was updated successfully, but these errors were encountered: