Learn R Programming

marinespeed (version 0.1.0)

plot_folds: plot folds

Description

plot_folds makes a rudimentary plot of the data and the folds created with e.g. kfold_disc or kfold.

Usage

plot_folds(data, folds, colors, ...)

Arguments

data
Matrix or dataframe. Data for which the folds where created. The first two columns should represent the longitude and latitude (or x,y coordinates).
folds
Numeric vector with group assignments from e.g. kfold_disc, kfold_grid or kfold.
colors
Colors to use for the different folds
...
Arguments to be passed to the plot function.

See Also

kfold_disc, kfold_grid, kfold

Examples

Run this code
set.seed(42)
lonlat_data <- cbind(runif(11, -180, 180), runif(11, -90, 90))
folds <- kfold_disc(lonlat_data, k = 5)
plot_folds(lonlat_data, folds)

Run the code above in your browser using DataLab