Learn R Programming

mlr3spatiotempcv (version 0.1.1)

autoplot.ResamplingSpCVBuffer: Visualization Functions for SpCV Buffer Methods.

Description

Generic S3 plot() and autoplot() (ggplot2) methods.

Usage

# S3 method for ResamplingSpCVBuffer
autoplot(
  object,
  task,
  fold_id = NULL,
  plot_as_grid = TRUE,
  train_color = "#0072B5",
  test_color = "#E18727",
  crs = NULL,
  ...
)

# S3 method for ResamplingSpCVBuffer plot(x, ...)

Arguments

object

[Resampling] mlr3 spatial resampling object of class ResamplingSpCVBuffer.

task

[TaskClassifST]/[TaskRegrST] mlr3 task object.

fold_id

[numeric] Fold IDs to plot.

plot_as_grid

[logical(1)] Should a gridded plot using via patchwork be created? If FALSE only a list with all ggplot2 resamplings is returned. Only applies if a numeric vector is passed to argument fold_id.

train_color

[character(1)] The color to use for the training set observations.

test_color

[character(1)] The color to use for the test set observations.

crs

[character] EPSG code of the CRS for x and y axes.

...

Not used.

x

[Resampling] mlr3 spatial resampling object of class ResamplingSpCVBuffer.

Examples

Run this code
# NOT RUN {
if (mlr3misc::require_namespaces(c("sf", "blockCV"), quietly = TRUE)) {
  library(mlr3)
  library(mlr3spatiotempcv)
  task = tsk("ecuador")
  resampling = rsmp("spcv_buffer", theRange = 10000)
  resampling$instantiate(task)

  autoplot(resampling, task, 1) +
    ggplot2::scale_x_continuous(breaks = seq(-79.085, -79.055, 0.01))
  autoplot(resampling, task, c(1, 2))
}
# }

Run the code above in your browser using DataLab