A bin defines the columns in an env workflow that collectively define the grain around which cleaning processes are aimed. This function is intended to explicitly link the grain in a scales.yaml with the bins used in the workflow.

grain_to_bin(
  scales_file = "settings/scales.yaml",
  scales_element = basename(here::here()),
  add = c("cell_lat", "cell_long"),
  remove = c("res_", "grain_time", "taxonomic")
)

Arguments

scales_file

Character. Path to the scales.yaml

scales_element

Character or numeric. Element within scales_file with the grain from which to extract bin information

add

Character. Any extra bin columns that cannot be extracted from the grain

remove

Character. Any regular expressions to exclude from the bin columns