plot.metaRangeSpecies {metaRange}R Documentation

Plotting function

Description

Plots the specified trait of a metaRangeSpecies object.

Usage

## S3 method for class 'metaRangeSpecies'
plot(x, trait_name, col, main = NULL, ...)

Arguments

x

⁠<metaRangeSpecies>⁠ metaRangeSpecies object.

trait_name

⁠<string>⁠ name of the trait to plot.

col

⁠<character>⁠ colors to use. Defaults to grDevices::hcl.colors() with n =50 and a random palette.

main

⁠<string>⁠ optional title of the plot. Will be labeled automatically when NULL.

...

additional arguments passed to terra::plot or base::plot.

Value

⁠<invisible NULL>⁠.

Examples

sim_env <- terra::sds(terra::rast(vals = 1, nrow = 2, ncol = 2))
names(sim_env) <- "env_01"
test_sim <- metaRangeSimulation$new(source_environment = sim_env)
test_sim$add_species("species_01")
test_sim$add_traits("species_01", trait_01 = matrix(1:4, nrow = 2, ncol = 2))
plot(test_sim$species_01, "trait_01")

[Package metaRange version 1.1.4 Index]