subsample {MorphoRegions} | R Documentation |
Subsample a dataset
Description
subsample()
creates a smaller version of the original dataset by sampling its rows. Because PCOs should be computed on the full dataset and most other functions take in regions_pco
objects, subsample()
requires a regions_pco
object as its input.
Usage
subsample(pco, sample = NULL, type = "seq")
Arguments
pco |
a |
sample |
|
type |
string; the type of subsampling to do, either |
Value
A regions_pco
object, a subset of the original supplied to pco
. The original dataset is stored as an attribute, which itself contains the subsampling indices.
See Also
svdPCO()
, process_measurements()
, plotvertmap()
to visualize the vertebral map after subsampling.
Examples
data("alligator")
alligator_data <- process_measurements(alligator,
pos = "Vertebra")
# Compute PCOs
alligator_PCO <- svdPCO(alligator_data)
# Plot vertebrae before subsampling
plotvertmap(alligator_PCO, dropNA = FALSE,
text = TRUE)
# Subsample data after estimating PCOs; subsample down
# to 15 vertebrae
alligator_PCO_sample <- subsample(alligator_PCO,
sample = 15)
# Plot vertebrae after subsampling; gray vertebrae
# have been dropped
plotvertmap(alligator_PCO_sample, dropNA = FALSE,
text = TRUE)