Skip to content

Commit 4b918db

Browse files
authored
Merge branch 'master' into hindi_s
2 parents f3fa21b + 299d44d commit 4b918db

27 files changed

+85
-71
lines changed

.ci/.lintr.R

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ linters = c(dt_linters, all_linters(
2626
# setwd = NULL
2727
# )),
2828
undesirable_operator_linter(),
29-
# TODO(lintr#2441): Use upstream implementation.
29+
# TODO(lintr#2765): Use upstream implementation.
30+
# assignment_linter(operator = "="),
3031
assignment_linter = NULL,
3132
absolute_path_linter = NULL, # too many false positives
3233
# TODO(lintr#2442): Use this once x[ , j, by] is supported.
@@ -84,7 +85,8 @@ exclusions = c(local({
8485
infix_spaces_linter = Inf,
8586
undesirable_function_linter = Inf
8687
)),
87-
exclusion_for_dir(c("vignettes", "vignettes/fr"), list(
88+
exclusion_for_dir(c("vignettes", "vignettes/fr", "vignettes/ru"), list(
89+
# assignment_linter = Inf,
8890
implicit_integer_linter = Inf,
8991
quotes_linter = Inf,
9092
sample_int_linter = Inf

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: data.table
2-
Version: 1.16.99
2+
Version: 1.17.99
33
Title: Extension of `data.frame`
44
Depends: R (>= 3.3.0)
55
Imports: methods

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ some:
1818

1919
.PHONY: clean
2020
clean:
21-
$(RM) data.table_1.16.99.tar.gz
21+
$(RM) data.table_1.17.99.tar.gz
2222
$(RM) src/*.o
2323
$(RM) src/*.so
2424

@@ -28,7 +28,7 @@ build:
2828

2929
.PHONY: install
3030
install:
31-
$(R) CMD INSTALL data.table_1.16.99.tar.gz
31+
$(R) CMD INSTALL data.table_1.17.99.tar.gz
3232

3333
.PHONY: uninstall
3434
uninstall:
@@ -40,7 +40,7 @@ test:
4040

4141
.PHONY: check
4242
check:
43-
_R_CHECK_CRAN_INCOMING_REMOTE_=false $(R) CMD check data.table_1.16.99.tar.gz --as-cran --ignore-vignettes --no-stop-on-test-error
43+
_R_CHECK_CRAN_INCOMING_REMOTE_=false $(R) CMD check data.table_1.17.99.tar.gz --as-cran --ignore-vignettes --no-stop-on-test-error
4444

4545
.PHONY: revision
4646
revision:

NEWS.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
**If you are viewing this file on CRAN, please check [latest news on GitHub](https://github.com/Rdatatable/data.table/blob/master/NEWS.md) where the formatting is also better.**
22

3-
# data.table [v1.16.99](https://github.com/Rdatatable/data.table/milestone/31) (in development)
3+
# data.table [v1.17.99](https://github.com/Rdatatable/data.table/milestone/35) (in development)
4+
5+
6+
7+
# data.table [v1.17.0](https://github.com/Rdatatable/data.table/milestone/34) (20 Feb 2025)
48

59
## POTENTIALLY BREAKING CHANGES
610

@@ -16,7 +20,7 @@ rowwiseDT(
1620
a=,b=,c=, d=,
1721
1, 2, "a", 2:3,
1822
3, 4, "b", list("e"),
19-
5, 6, "c", ~a+b,
23+
5, 6, "c", ~a+b
2024
)
2125
#> a b c d
2226
#> <num> <num> <char> <list>

R/IDateTime.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,15 @@ rep.ITime = function(x, ...)
235235
y
236236
}
237237

238-
round.ITime <- function(x, digits = c("hours", "minutes"), ...)
238+
round.ITime = function(x, digits = c("hours", "minutes"), ...)
239239
{
240240
(setattr(switch(match.arg(digits),
241241
hours = as.integer(round(unclass(x)/3600.0)*3600.0),
242242
minutes = as.integer(round(unclass(x)/60.0)*60.0)),
243243
"class", "ITime"))
244244
}
245245

246-
trunc.ITime <- function(x, units = c("hours", "minutes"), ...)
246+
trunc.ITime = function(x, units = c("hours", "minutes"), ...)
247247
{
248248
(setattr(switch(match.arg(units),
249249
hours = as.integer(unclass(x)%/%3600.0*3600.0),

R/as.data.table.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ as.data.table.matrix = function(x, keep.rownames=FALSE, key=NULL, ...) {
6363
for (i in ic) value[[i]] = x[, i] # <strike>for efficiency.</strike> For consistency - data.table likes and prefers "character"
6464
}
6565
else {
66-
for (i in ic) value[[i]] <- as.vector(x[, i]) # to drop any row.names that would otherwise be retained inside every column of the data.table
66+
for (i in ic) value[[i]] = as.vector(x[, i]) # to drop any row.names that would otherwise be retained inside every column of the data.table
6767
}
6868
col_labels = dimnames(x)[[2L]]
6969
setDT(value)

R/between.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ between = function(x, lower, upper, incbounds=TRUE, NAbounds=TRUE, check=FALSE)
6060
y = eval.parent(ysub)
6161
}
6262
if ((l <- length(y)) != 2L) {
63-
suggestion <- if (ysub %iscall% 'c') gettextf("Perhaps you meant %s? ", capture.output(print(`[[<-`(ysub, 1L, quote(list))))) else ""
63+
suggestion = if (ysub %iscall% 'c') gettextf("Perhaps you meant %s? ", capture.output(print(`[[<-`(ysub, 1L, quote(list))))) else ""
6464
stopf("RHS has length() %d; expecting length 2. %sThe first element should be the lower bound(s); the second element should be the upper bound(s).", l, suggestion)
6565
}
6666
between(x, y[[1L]], y[[2L]], incbounds=TRUE)

R/cedta.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ cedta.pkgEvalsUserCode = c("gWidgetsWWW","statET","FastRWeb","slidify","rmarkdow
2828

2929
# nocov start: very hard to reach this within our test suite -- the call stack within a call generated by e.g. knitr
3030
# for loop, not any(vapply_1b(.)), to allow early exit
31-
.any_eval_calls_in_stack <- function() {
31+
.any_eval_calls_in_stack = function() {
3232
calls = sys.calls()
3333
# likelier to be close to the end of the call stack, right?
3434
for (ii in length(calls):1) { # nolint: seq_linter. rev(seq_len(length(calls)))? See https://bugs.r-project.org/show_bug.cgi?id=18406.
35-
the_call <- calls[[ii]][[1L]]
35+
the_call = calls[[ii]][[1L]]
3636
if (is.name(the_call) && (the_call %chin% c("eval", "evalq"))) return(TRUE)
3737
}
3838
FALSE

R/data.table.R

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ replace_dot_alias = function(e) {
108108
# eval(parse()) to avoid "no visible binding for global variable" note from R CMD check
109109
# names starting with _ don't parse, so no leading _ in the name
110110
)
111-
idx <- regexpr(missing_obj_fmt, err$message, perl=TRUE)
111+
idx = regexpr(missing_obj_fmt, err$message, perl=TRUE)
112112
if (idx > 0L) {
113113
start = attr(idx, "capture.start", exact=TRUE)[ , "obj_name"]
114114
used = substr(
@@ -703,7 +703,7 @@ replace_dot_alias = function(e) {
703703
names(..syms) = ..syms
704704
j = eval(jsub, lapply(substr(..syms, 3L, nchar(..syms)), get, pos=parent.frame()), parent.frame())
705705
}
706-
if (is.logical(j)) j <- which(j)
706+
if (is.logical(j)) j = which(j)
707707
if (!length(j) && !notj) return( null.data.table() )
708708
if (is.factor(j)) j = as.character(j) # fix for FR: #358
709709
if (is.character(j)) {
@@ -1138,7 +1138,7 @@ replace_dot_alias = function(e) {
11381138
if (!all(named_idx <- nzchar(lhs))) {
11391139
# friendly error for common case: trailing terminal comma
11401140
n_lhs = length(lhs)
1141-
this_call <- if (root == "let") "let" else "`:=`"
1141+
this_call = if (root == "let") "let" else "`:=`"
11421142
.check_nested_walrus(jsub, which(!named_idx)+1L, this_call)
11431143
if (!named_idx[n_lhs] && all(named_idx[-n_lhs])) {
11441144
stopf("In %s(col1=val1, col2=val2, ...) form, all arguments must be named, but the last argument has no name. Did you forget a trailing comma?", this_call)
@@ -1183,7 +1183,7 @@ replace_dot_alias = function(e) {
11831183
} else {
11841184
# Adding new column(s). TO DO: move after the first eval in case the jsub has an error.
11851185
newnames=setdiff(lhs, names_x)
1186-
m[is.na(m)] = ncol(x)+seq_len(length(newnames))
1186+
m[is.na(m)] = ncol(x)+seq_along(newnames)
11871187
cols = as.integer(m)
11881188
# don't pass verbose to selfrefok here -- only activated when
11891189
# ok=-1 which will trigger setalloccol with verbose in the next
@@ -1288,7 +1288,7 @@ replace_dot_alias = function(e) {
12881288
# warningf(sym," in j is looking for ",getName," in calling scope, but a column '", sym, "' exists. Column names should not start with ..")
12891289
}
12901290
getName = substr(sym, 3L, nchar(sym))
1291-
getNameVal <- get0(getName, parent.frame())
1291+
getNameVal = get0(getName, parent.frame())
12921292
if (is.null(getNameVal)) {
12931293
if (exists(sym, parent.frame())) next # user did 'manual' prefix; i.e. variable in calling scope has .. prefix
12941294
stopf("Variable '%s' is not found in calling scope. Looking in calling scope because this symbol was prefixed with .. in the j= parameter.", getName)
@@ -2166,8 +2166,8 @@ as.matrix.data.table = function(x, rownames=NULL, rownames.value=NULL, ...) {
21662166
internal_error("length(X)==%d but a dimension is zero", length(X)) # nocov
21672167
return(array(if (is.null(X)) NA else X, dim = dm, dimnames = list(rownames.value, cn)))
21682168
}
2169-
dim(X) <- c(n, length(X)/n)
2170-
dimnames(X) <- list(rownames.value, unlist(collabs, use.names = FALSE))
2169+
dim(X) = c(n, length(X)/n)
2170+
dimnames(X) = list(rownames.value, unlist(collabs, use.names = FALSE))
21712171
X
21722172
}
21732173

@@ -2380,7 +2380,7 @@ subset.data.table = function(x, subset, select, ...)
23802380
## Set the key on the returned data.table as long as the key
23812381
## columns that "remain" are the same as the original, or a
23822382
## prefix of it.
2383-
is.prefix = all(key(x)[seq_len(length(key.cols))] == key.cols)
2383+
is.prefix = all(key(x)[seq_along(key.cols)] == key.cols)
23842384
if (is.prefix) {
23852385
setattr(ans, "sorted", key.cols)
23862386
}
@@ -2454,7 +2454,7 @@ split.data.table = function(x, f, drop = FALSE, by, sorted = FALSE, keep.by = TR
24542454
# same as split.data.frame - handling all exceptions, factor orders etc, in a single stream of processing was a nightmare in factor and drop consistency
24552455
# evaluate formula mirroring split.data.frame #5392. Mimics base::.formula2varlist.
24562456
if (inherits(f, "formula"))
2457-
f <- eval(attr(terms(f), "variables"), x, environment(f))
2457+
f = eval(attr(terms(f), "variables"), x, environment(f))
24582458
# be sure to use x[ind, , drop = FALSE], not x[ind], in case downstream methods don't follow the same subsetting semantics (#5365)
24592459
return(lapply(split(x = seq_len(nrow(x)), f = f, drop = drop, ...), function(ind) x[ind, , drop = FALSE]))
24602460
}
@@ -2559,7 +2559,7 @@ copy = function(x) {
25592559
## get correct key if cols are present
25602560
cols = names(x)[cols]
25612561
keylength = which.first(!key(ans) %chin% cols) - 1L
2562-
if (is.na(keylength)) keylength <- length(key(ans))
2562+
if (is.na(keylength)) keylength = length(key(ans))
25632563
if (!keylength) {
25642564
setattr(ans, "sorted", NULL) ## no key remaining
25652565
} else {
@@ -2867,7 +2867,7 @@ setDF = function(x, rownames=NULL) {
28672867
stopf("All elements in argument 'x' to 'setDF' must be of same length")
28682868
xn = names(x)
28692869
if (is.null(xn)) {
2870-
setattr(x, "names", paste0("V",seq_len(length(x))))
2870+
setattr(x, "names", paste0("V",seq_along(x)))
28712871
} else {
28722872
idx = !nzchar(xn) # NB: keepNA=FALSE intentional
28732873
if (any(idx)) {
@@ -3086,9 +3086,9 @@ gweighted.mean = function(x, w, ..., na.rm=FALSE) {
30863086
if (missing(w)) gmean(x, na.rm)
30873087
else {
30883088
if (na.rm) { # take those indices out of the equation by setting them to 0
3089-
ix <- is.na(x)
3090-
x[ix] <- 0.0
3091-
w[ix] <- 0.0
3089+
ix = is.na(x)
3090+
x[ix] = 0.0
3091+
w[ix] = 0.0
30923092
}
30933093
gsum((w!=0.0)*x*w, na.rm=FALSE)/gsum(w, na.rm=FALSE)
30943094
}
@@ -3157,7 +3157,7 @@ is_constantish = function(q, check_singleton=FALSE) {
31573157

31583158
# Check for na.rm= in expr in the expected slot; allows partial matching and
31593159
# is robust to unnamed expr. Note that NA names are not possible here.
3160-
.arg_is_narm <- function(expr, which=3L) !is.null(nm <- names(expr)[which]) && startsWith(nm, "na")
3160+
.arg_is_narm = function(expr, which=3L) !is.null(nm <- names(expr)[which]) && startsWith(nm, "na")
31613161

31623162
.gforce_ok = function(q, x) {
31633163
if (is.N(q)) return(TRUE) # For #334

R/fcast.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ guess = function(x) {
88
var
99
}
1010

11-
dcast <- function(
11+
dcast = function(
1212
data, formula, fun.aggregate = NULL, ..., margins = NULL,
1313
subset = NULL, fill = NULL, value.var = guess(data)
1414
) {
@@ -115,7 +115,7 @@ aggregate_funs = function(funs, vals, sep="_", ...) {
115115
if (is.null(nm) || !nzchar(nm)) {
116116
nm = all.names(funs[[i]], max.names=1L, functions=TRUE)
117117
}
118-
if (!length(nm)) nm <- paste0("fun", i)
118+
if (!length(nm)) nm = paste0("fun", i)
119119
construct_funs(funs[i], nm, vals[[i]])
120120
})
121121
as.call(c(quote(list), unlist(ans)))
@@ -185,7 +185,7 @@ dcast.data.table = function(data, formula, fun.aggregate = NULL, sep = "_", ...,
185185
fun.call = aggregate_funs(fun.call, lvals, sep, ...)
186186
maybe_err = function(list.of.columns) {
187187
if (!all(lengths(list.of.columns) == 1L)) {
188-
msg <- gettext("Aggregating functions should take a vector as input and return a single value (length=1), but they do not, so the result is undefined. Please fix by modifying your function so that a single value is always returned.")
188+
msg = gettext("Aggregating functions should take a vector as input and return a single value (length=1), but they do not, so the result is undefined. Please fix by modifying your function so that a single value is always returned.")
189189
if (is.null(fill)) { # TODO change to always stopf #6329
190190
stop(msg, domain=NA, call. = FALSE)
191191
} else {

0 commit comments

Comments
 (0)