Skip to content

Commit 1c56394

Browse files
committed
refactor: match mlr3 style for j in data table
1 parent 3ba4f8e commit 1c56394

File tree

5 files changed

+4
-6
lines changed

5 files changed

+4
-6
lines changed

R/ResamplingFcstCV.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ ResamplingFcstCV = R6Class(
132132
list(train_ids = train_ids, test_ids = test_ids)
133133
},
134134
by = key_cols
135-
][, .(train_ids, test_ids)]
135+
][, list(train_ids, test_ids)]
136136
train_ids = ids$train_ids
137137
test_ids = ids$test_ids
138138
}

R/TaskFcstElectricty.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ load_task_electricty = function(id = "electricity") {
1818
dt = as.data.table(load_dataset("vic_elec", "tsibbledata"))
1919
setnames(dt, tolower)
2020
demand = temperature = holiday = NULL
21-
dt = dt[, .(demand = sum(demand), temperature = max(temperature), holiday = any(holiday)), by = date]
21+
dt = dt[, list(demand = sum(demand), temperature = max(temperature), holiday = any(holiday)), by = date]
2222
b = as_data_backend(dt)
2323

2424
task = TaskFcst$new(

R/as_task_fcst.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ as_task_fcst.data.frame = function(
100100

101101
has_dups = NULL
102102
dup = if (has_key) {
103-
x[, .(has_dups = anyDuplicated(get(order)) > 0L), by = key][, any(has_dups)]
103+
x[, list(has_dups = anyDuplicated(get(order)) > 0L), by = key][, any(has_dups)]
104104
} else {
105105
anyDuplicated(x[[order]]) > 0L
106106
}

R/tsf.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ read_tsf = function(file) {
8282
}
8383
}
8484

85-
dt_long = dt[, .(value = strsplit1(value, ",")), by = col_names]
85+
dt_long = dt[, list(value = strsplit1(value, ",")), by = col_names]
8686
dt_long["?", value := NA_character_, on = "value"]
8787
dt_long[, value := as.numeric(value)]
8888
dt[, value := NULL]

R/zzz.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
#' @importFrom stats as.ts
1010
"_PACKAGE"
1111

12-
utils::globalVariables(".")
13-
1412
mlr3forecast_resamplings = new.env()
1513
mlr3forecast_tasks = new.env()
1614
mlr3forecast_learners = new.env()

0 commit comments

Comments
 (0)