You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Slow="73d79edf8ff8c55163e90631072192301056e336", # Parent of the first commit in the PR (https://github.com/Rdatatable/data.table/commit/8397dc3c993b61a07a81c786ca68c22bc589befc)
278
278
Fast="8397dc3c993b61a07a81c786ca68c22bc589befc"), # Commit in the PR (https://github.com/Rdatatable/data.table/pull/7019/commits) that removes inefficiency
279
279
280
+
"isoweek improved in #7144"=atime::atime_test(
281
+
setup= {
282
+
set.seed(349)
283
+
x= sample(Sys.Date() -0:5000, N, replace=TRUE)
284
+
},
285
+
expr=data.table::isoweek(x),
286
+
Slow="548410d23dd74b625e8ea9aeb1a5d2e9dddd2927", # Parent of the first commit in the PR (https://github.com/Rdatatable/data.table/commit/548410d23dd74b625e8ea9aeb1a5d2e9dddd2927)
287
+
Fast="c0b32a60466bed0e63420ec105bc75c34590865e"), # Commit in the PR (https://github.com/Rdatatable/data.table/pull/7144/commits) that uses a much faster implementation
Copy file name to clipboardExpand all lines: NEWS.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,10 @@
42
42
43
43
8.`groupingsets()`getsanewargument`enclos`forusetogetherwiththe`jj`argumentinfunctionswrapping`groupingsets()`, includingtheexistingwrappers`rollup()`and`cube()`, [#5560](https://github.com/Rdatatable/data.table/issues/5560). When forwarding a `j`-expression as `groupingsets(jj = substitute(j))`, make sure to pass `enclos = parent.frame()` as well, so that the `j`-expression will be evaluated in the right context. This makes it possible for `j` to refer to variables outside the `data.table`. Thanks @sindribaldur for the report and @aitap for the fix.
44
44
45
+
9.`isoweek()`ismuch faster (e.g.20x) byre-usinganimplementationfrom {base}, [#5111](https://github.com/Rdatatable/data.table/issues/5111). Thanks @MichaelChirico for the report and PR.
46
+
47
+
10.`data.table()`and`as.data.table()`with`keep.rownames=TRUE`nowextractrownamesfromnamedvectors, matching`data.frame()`behavior.Namesfromthefirstnamedvectorintheinputareusedtocreatetherownames column (defaultname`"rn"`orcustomnamevia`keep.rownames="column_name"`), [#1916](https://github.com/Rdatatable/data.table/issues/1916). Thanks to @richierocks for the feature request and @Mukulyadav2004 for the implementation.
48
+
45
49
### BUG FIXES
46
50
47
51
1.Custombinaryoperatorsfromthe`lubridate`packagenowworkwithobjectsofclass`IDate`aswitha`Date`subclass, [#6839](https://github.com/Rdatatable/data.table/issues/6839). Thanks @emallickhossain for the report and @aitap for the fix.
origListNames=if (missing(.named)) names(x) elseNULL# as.data.table called directly, not from inside data.table() which provides .named, #3854
138
138
empty_atomic=FALSE
139
+
140
+
# Handle keep.rownames for vectors (mimicking data.frame behavior)
141
+
rownames_=NULL
142
+
check_rownames=!isFALSE(keep.rownames)
143
+
139
144
for (iin seq_len(n)) {
140
145
xi=x[[i]]
141
146
if (is.null(xi)) next# eachncol already initialized to 0 by integer() above
147
+
if (check_rownames&& is.null(rownames_)) {
148
+
if (is.null(dim(xi))) {
149
+
if (!is.null(nm<- names(xi))) {
150
+
rownames_=nm
151
+
x[[i]] = unname(xi)
152
+
}
153
+
} else {
154
+
if (!is.null(nm<- rownames(xi))) {
155
+
rownames_=nm
156
+
}
157
+
}
158
+
}
142
159
if (!is.null(dim(xi)) &&missing.check.names) check.names=TRUE
143
160
if ("POSIXlt" %chin% class(xi)) {
144
161
warningf("POSIXlt column type detected and converted to POSIXct. We do not recommend use of POSIXlt at all because it uses 40 bytes to store one date.")
Copy file name to clipboardExpand all lines: man/as.data.table.Rd
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ is.data.table(x)
31
31
}
32
32
\arguments{
33
33
\item{x}{AnRobject.}
34
-
\item{keep.rownames}{Defaultis \code{FALSE}.If \code{TRUE}, addstheinputobject's names as a separate column named \code{"rn"}. \code{keep.rownames = "id"} names the column \code{"id"} instead.}
34
+
\item{keep.rownames}{Defaultis \code{FALSE}.If \code{TRUE}, addstheinputobject's names as a separate column named \code{"rn"}. \code{keep.rownames = "id"} names the column \code{"id"} instead. For lists and when calling \code{data.table()}, names from the first named vector are extracted and used as row names, similar to \code{data.frame()} behavior.}
35
35
\item{key}{ Character vector of one or more column names which is passed to \code{\link{setkeyv}}. }
36
36
\item{sorted}{logical used in \emph{array} method, default \code{TRUE} is overridden when \code{key} is provided. }
37
37
\item{value.name}{character scalar used in \emph{array} method, default \code{"value"}.}
0 commit comments