Skip to content

Commit 51d54dc

Browse files
authored
fledge: CRAN release v2.3.4 (#248)
1 parent 16816e2 commit 51d54dc

File tree

7 files changed

+59
-52
lines changed

7 files changed

+59
-52
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: mlr3spatiotempcv
22
Title: Spatiotemporal Resampling Methods for 'mlr3'
3-
Version: 2.3.3.9000
3+
Version: 2.3.4
44
Authors@R: c(
55
person("Patrick", "Schratz", , "[email protected]", role = c("aut", "cre"),
66
comment = c(ORCID = "0000-0003-0748-6624")),
@@ -65,7 +65,7 @@ Encoding: UTF-8
6565
LazyData: true
6666
NeedsCompilation: no
6767
Roxygen: list(markdown = TRUE, r6 = TRUE)
68-
RoxygenNote: 7.3.2
68+
RoxygenNote: 7.3.3
6969
Collate:
7070
'aaa.R'
7171
'ResamplingRepeatedSpCVBlock.R'

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- NEWS.md is maintained by https://fledge.cynkra.com, contributors should not edit this file -->
22

3-
# mlr3spatiotempcv 2.3.3.9000
3+
# mlr3spatiotempcv 2.3.4
44

55
## Chore
66

R/ResamplingRepeatedSpCVknndm.R

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,30 @@
1313
#'
1414
#' @export
1515
#' @examples
16-
#' library(mlr3)
17-
#' library(mlr3spatial)
18-
#' set.seed(42)
19-
#' simarea = list(matrix(c(0, 0, 0, 100, 100, 100, 100, 0, 0, 0), ncol = 2, byrow = TRUE))
20-
#' simarea = sf::st_polygon(simarea)
21-
#' train_points = sf::st_sample(simarea, 1000, type = "random")
22-
#' train_points = sf::st_as_sf(train_points)
23-
#' train_points$target = as.factor(sample(c("TRUE", "FALSE"), 1000, replace = TRUE))
24-
#' pred_points = sf::st_sample(simarea, 1000, type = "regular")
16+
#' if (requireNamespace(c("mlr3spatial", "mlr3"))) {
17+
#' library(mlr3)
18+
#' library(mlr3spatial)
19+
#' set.seed(42)
20+
#' simarea = list(matrix(c(0, 0, 0, 100, 100, 100, 100, 0, 0, 0), ncol = 2, byrow = TRUE))
21+
#' simarea = sf::st_polygon(simarea)
22+
#' train_points = sf::st_sample(simarea, 1000, type = "random")
23+
#' train_points = sf::st_as_sf(train_points)
24+
#' train_points$target = as.factor(sample(c("TRUE", "FALSE"), 1000, replace = TRUE))
25+
#' pred_points = sf::st_sample(simarea, 1000, type = "regular")
2526
#'
26-
#' task = mlr3spatial::as_task_classif_st(sf::st_as_sf(train_points), "target", positive = "TRUE")
27+
#' task = mlr3spatial::as_task_classif_st(sf::st_as_sf(train_points), "target", positive = "TRUE")
2728
#'
28-
#' cv_knndm = rsmp("repeated_spcv_knndm", predpoints = pred_points, repeats = 2)
29-
#' cv_knndm$instantiate(task)
30-
31-
#' #' ### Individual sets:
32-
#' # cv_knndm$train_set(1)
33-
#' # cv_knndm$test_set(1)
34-
#' # check that no obs are in both sets
35-
#' intersect(cv_knndm$train_set(1), cv_knndm$test_set(1)) # good!
29+
#' cv_knndm = rsmp("repeated_spcv_knndm", predpoints = pred_points, repeats = 2)
30+
#' cv_knndm$instantiate(task)
31+
#' ### Individual sets:
32+
#' # cv_knndm$train_set(1)
33+
#' # cv_knndm$test_set(1)
34+
#' # check that no obs are in both sets
35+
#' intersect(cv_knndm$train_set(1), cv_knndm$test_set(1)) # good!
3636
#'
37-
#' # Internal storage:
38-
#' # cv_knndm$instance # table
37+
#' # Internal storage:
38+
#' # cv_knndm$instance # table
39+
#' }
3940
ResamplingRepeatedSpCVKnndm = R6Class("ResamplingRepeatedSpCVKnndm",
4041
inherit = mlr3::Resampling,
4142
public = list(

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To cite the package in publications, use the output of `citation("mlr3spatiotemp
4545

4646
## Resources
4747

48-
- [Recorded talk about mlr3spatiotempcv and mlr3spatial at OpenDataScience Europe Conference 2021 in Wageningen, NL](https://av.tib.eu/media/55271)
48+
- [Recorded talk about mlr3spatiotempcv and mlr3spatial at OpenDataScience Europe Conference 2021 in Wageningen, NL](https://www.youtube.com/watch?v=lWOMsmeWfEo)
4949
- [List of scientific articles related to spatiotemporal modeling and/or spatial partitioning](https://pat-s.notion.site/Spatial-autocorrelation-in-modeling-b62e1bc904b546b9a489b171913a3551)
5050

5151
# Other spatiotemporal resampling packages

cran-comments.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mlr3spatiotempcv 2.3.3
1+
mlr3spatiotempcv 2.3.4
22

33
## Cran Repository Policy
44

man/mlr_resamplings_repeated_spcv_knndm.Rd

Lines changed: 24 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-2-autoplot.R

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test_that("plot() works for 'sptcv_cstf' 2D - time_var", {
2323

2424
expect_true(is_ggplot(p1))
2525
expect_true(is_ggplot(p2))
26-
expect_list(p3)
26+
expect_s3_class(p3, "patchwork")
2727

2828
p4 = autoplot(rsp, tsk_cookfarm_sub, repeats_id = 2, sample_fold_n = 3L)
2929
p5 = autoplot(rsp, tsk_cookfarm_sub, fold_id = 1, repeats_id = 2,
@@ -66,7 +66,7 @@ test_that("plot() works for 'sptcv_cstf' 2D - space_var", {
6666

6767
expect_true(is_ggplot(p1))
6868
expect_true(is_ggplot(p2))
69-
expect_list(p3)
69+
expect_s3_class(p3, "patchwork")
7070

7171
p4 = autoplot(rsp, tsk_cookfarm_sub, repeats_id = 2, sample_fold_n = 3L)
7272
p5 = autoplot(rsp, tsk_cookfarm_sub, fold_id = 1, repeats_id = 2,
@@ -232,7 +232,7 @@ test_that("plot() works for 'spcv_disc'", {
232232

233233
expect_true(is_ggplot(p1))
234234
expect_true(is_ggplot(p2))
235-
expect_list(p3)
235+
expect_s3_class(p3, "patchwork")
236236
expect_true(is_ggplot(p4))
237237

238238
p5 = autoplot(rsp, task, repeats_id = 2)
@@ -260,6 +260,10 @@ test_that("plot() works for 'spcv_disc'", {
260260

261261
test_that("train_color and test_color parameters work for resampling methods", {
262262
skip_if_not_installed("ggplot2")
263+
skip_if_not_installed("vdiffr")
264+
skip_if_not_installed("sf")
265+
skip_if_not_installed("patchwork")
266+
skip_if_not_installed("ggtext")
263267

264268
set.seed(42)
265269

@@ -323,7 +327,7 @@ test_that("plot() works for 'spcv_tiles'", {
323327

324328
expect_true(is_ggplot(p1))
325329
expect_true(is_ggplot(p2))
326-
expect_list(p3)
330+
expect_s3_class(p3, "patchwork")
327331
expect_true(is_ggplot(p4))
328332

329333
p5 = autoplot(rsp, task, c(1, 2), repeats_id = 2)
@@ -376,7 +380,7 @@ test_that("plot() works for 'spcv_knndm'", {
376380

377381
expect_true(is_ggplot(p1))
378382
expect_true(is_ggplot(p2))
379-
expect_list(p3)
383+
expect_s3_class(p3, "patchwork")
380384

381385
p5 = autoplot(rsp, task, repeats_id = 2)
382386
p6 = autoplot(rsp, task, fold_id = 1, repeats_id = 2)

0 commit comments

Comments
 (0)