-
Notifications
You must be signed in to change notification settings - Fork 993
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
Upcoming versions of base R eliminate the need for DT() functionality - consider eliminating? #5621
Comments
I agree it would be good to remove if possible, to avoid user confusion, and to save dev time. |
given the number of headaches induced by what was supposed to be a "simple" wrapper, I would also be very happy to drop DT(). that said, I would pause on this issue until that syntax lands in a released version. |
@markfairbanks care to elaborate? it will be important feedback. |
I would love to have a And as far as the current issues - every issue linked in the original comment goes back to the fact that Something like this: library(data.table)
DT <- function(x, ...) {
if (!is.data.table(x)) {
stop("`x` must be a data.table")
}
x[...]
}
df <- data.table(x = 1:3, y = c("a", "a", "b"))
copy(df) |>
DT(, double_x := x * 2) |>
DT()
#> x y double_x
#> <int> <char> <num>
#> 1: 1 a 2
#> 2: 2 a 4
#> 3: 3 b 6 There wouldn't be anything "surprising" with how it works because it would work exactly like |
Agree - but perhaps might be a reason to hold back
Since backporting ## Works R > 3.4 using magrittr
as.data.table(mtcars) %>%
.[am == 1] %>%
.[, .(maxhp = max(hp)), by = .(cyl)]
|
I think it still makes more sense to have a functional
|
As we all got used to working with the dev version of So with the caveat that I am not fully up to speed on any implementation headaches, my $0.02 are for shipping |
I think that it would be useful to export I personally believe that the most important benefit of But I believe that While piping using the square brackets (repeatedly) was hard to follow and kept indenting the codes to the right, the upcoming R version literally solves this issue. I really like the fact that the square brackets are vertically aligned (with no additional indentation). In conclusion, I would suggest to keep |
Whenever size is not a problem you can just alias DT=as.data.table and use [ |
another couple pieces of information that may be relevant to this discussion
|
if we do keep DT, can someone (@markfairbanks or?) please volunteer to maintain it and review changes to it, by adding your name to the new/proposed CODEOWNERS file? #5629 (currently DT is defined in data.table.R but maybe would be better to move it to a separate file, to make it clear who is responsible for it) |
Anyway DT() is not going to land on CRAN as long as pending issues related to it are not being addressed. Putting it on CRAN having those issue would be a nightmare, and most likely new issues would be detected as well. |
FYI in the survey about 2/3 of users indicated they'd find such a convenience function somewhat or very useful. (I've submitted a summary of results for publication on the data.table blog.) |
One thing I don't like about the name DT is that it requires holding down the Shift key. An alternative I'd propose is |
I agree that something simple (and lowercase) would be useful. |
Since I don't quite get why the name should be 'clearly tied to data.table'. If the package includes e.g. |
Yeah I know what you mean. I don't think it would have to be dt or td or anything with the exact same name. Just meant having some clear connection so it's easier for our users to find this function and know what it does. |
In upcoming versions of R, syntax such as the following will be supported:
With this in mind, I think it's worth reconsidering whether
DT()
should remain on the release roadmap.Some arguments in favor of scrapping
DT()
are as follows:dt |> _[...]
will address all use cases forDT()
[.data.table
will be confusing for new users. Advertising this functionality also eliminates an opportunity to educate users about existingdt[...][...]
chaining capabilities baked in by defaultDT()
will lead to namespace collision issues with theDT::DT()
exported by the widely used DT packageDT()
acceptance of nondata.table
objects is likely to cause user confusiondata.frame
rownames names #5430DT()
#5129DT()
going forward will be a drain on valuable maintainer's time -DT()
Labeled IssuesDT()
has not yet been exported in a CRAN release so no there will no impacts to reverse dependencies and limited impact to users who have adopted this formThat being said, this is just my two cents as a satisfied user of
data.table
interested in the long term success of the package. Happy to hear counter arguments, and open to the idea that the broader community may see enough value to finish the push to supportDT()
.The text was updated successfully, but these errors were encountered: