Skip to contents

Replaces the pattern label stored in a landscape object.

Usage

set_landscape_pattern(x, pattern)

Arguments

x

A landscape object.

pattern

Character. New pattern label to store.

Value

The landscape object with its updated pattern label.

Examples

# Single landscape
landscape <- create_landscape("sharp", width = 10, height = 10)
landscape <- set_landscape_pattern(landscape, "sharp_treeline")

# Multiple landscapes with purrr
landscapes <- list(
  create_landscape("sharp", width = 10, height = 10),
  create_landscape("random", width = 10, height = 10)
)
patterns_vec <- c("sharp_treeline", "random_pattern")
landscapes <- purrr::map2(landscapes, patterns_vec, set_landscape_pattern)

# Multiple landscapes with base R
landscapes <- mapply(
  set_landscape_pattern, landscapes, patterns_vec,
  SIMPLIFY = FALSE
)