Skip to content

Commit

Permalink
Closes #593 -- added edit.data.table
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Chirico committed Aug 18, 2019
1 parent a8e926a commit 646c06d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export(dcast, melt)
S3method(dcast, data.table)
S3method(melt, data.table)

# exported for historical reasons -- if reshape2 is higher on search path,
# exported for historical reasons -- if reshape2 is higher on search path,
# dcast(DT) will not dispatch since reshape2::dcast is not generic. So users
# and many packges on CRAN call dcast.data.table() and/or melt.data.table() directly. See #3082.
export(melt.data.table, dcast.data.table)
Expand Down Expand Up @@ -165,6 +165,7 @@ S3method(seq, ITime)
S3method(unique, IDate)
S3method(unique, ITime)
S3method('[<-', IDate)
S3method(edit, data.table)

# duplist
# getdots
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@
22. `transpose` gains `keep.names=` and `make.names=` arguments, [#1886](https://github.com/Rdatatable/data.table/issues/1886). Previously, column names were dropped and there was no way to keep them. `keep.names="rn"` keeps the column names and puts them in the `"rn"` column of the result. Similarly, `make.names="rn"` uses column `"rn"` as the column names of the result. Both arguments are `NULL` by default for backwards compatibility. As these new arguments are new, they are subject to change in future according to community feedback. Thanks to @ghost for the request.
23. Added a `data.table` method for `utils::edit` to ensure a `data.table` is returned, for convenience, [#593](https://github.com/Rdatatable/data.table/issues/593).
#### BUG FIXES
1. `first`, `last`, `head` and `tail` by group no longer error in some cases, [#2030](https://github.com/Rdatatable/data.table/issues/2030) [#3462](https://github.com/Rdatatable/data.table/issues/3462). Thanks to @franknarf1 for reporting.
Expand Down
6 changes: 6 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,9 @@ do_patterns = function(pat_sub, all_cols) {

return(matched)
}

# nocov start #593 always return a data.table
edit.data.table = function(name, ...) {
setDT(NextMethod('edit', name))[]
}
# nocov end

0 comments on commit 646c06d

Please sign in to comment.