name_env_out: Use meta data to name or parse output paths

View source: R/name_env_out.R

name_env_outR Documentation

Use meta data to name or parse output paths

Description

Either create file path for saving outputs or parse the meta data from a path

Usage

name_env_out(
  x,
  context_defn = c("vector", "filt_col", "level", "buffer", "res"),
  parse = FALSE,
  fill_null = FALSE,
  x_null = 2,
  ...
)

Arguments

x

Either dataframe with path(s) to parse (in column path), character vector of path(s) to search, or named list object.

context_defn

Character vector of meta data names (in order)

parse

Logical. If FALSE (default) an out_dir path will be returned rather than parsed. Assumes the appropriate names can be found in x.

fill_null

Logical. If TRUE, will fill up to x_null definitions with NULL (and issue a warning).

x_null

Numeric. Even if fill_null is TRUE, if there are more than x_null missing definitions, an error will be thrown.

...

Not used

Value

If !parse, tibble with columns:

vector

Vector layer originally used to define area of interest

filt_col

Column name from vector to filter to define area of interest

level

Level(s) of filt_col originally filtered to define area of interest

buffer

Any buffer around area of interest

res

Resolution of output raster in units of rasters crs

path

Full (relative) path including file_type.

If !parse, df with additional column out_dir


Acanthiza/envFunc documentation built on Aug. 19, 2024, 4:50 a.m.