Create a ggplot for spatial resamples.Source:
This method provides a good visualization method for spatial resampling.
spatial_rsetobject or a
spatial_rsplitobject. Note that only resamples made from
spatial_rsplitobjects; this function will not work for resamples made with non-spatial tibbles or data.frames.
Options passed to
Opacity, passed to
ggplot2::geom_sf(). Values of alpha range from 0 to 1, with lower values corresponding to more transparent colors.
When plotting spatial_block_cv objects, should the grid itself be drawn on top of the data? Set to FALSE to remove the grid.
A ggplot object with each fold assigned a color, made using
The plot method for
spatial_rset displays which fold each observation
is assigned to. Note that if data is assigned to multiple folds
(which is common if resamples were created with a non-zero
the "last" fold for each observation will appear on the plot.
ggplot2::facet_wrap(~ fold) to visualize all members of
each fold separately.
Alternatively, consider plotting each split using the
(for example, via
boston_block <- spatial_block_cv(boston_canopy, v = 2) autoplot(boston_block) autoplot(boston_block$splits[])