ms_extract_var_prefix: Extract MacroSheds variable prefixes (DEPRECATED)

View source: R/ms_extract_var_prefix.R

ms_extract_var_prefixR Documentation

Extract MacroSheds variable prefixes (DEPRECATED)

Description

Isolate the two-letter prefixes from MacroSheds variable codes. Retained for legacy use, but will be removed in a later version. See details.

Usage

ms_extract_var_prefix(x)

Arguments

x

character. MacroSheds variable code with a prefix.

Details

In version 1 of the MacroSheds dataset, variable codes all include a two-letter prefix to denote the sampling regimen. The first letter is either I for "installed" or G for "grab," denoting if this variable was recorded by a continuously monitoring piece of equipment, or manually by a human. The second position is either S for "sensor" or N for "non-sensor". Non-sensor samples are generally measured analytically, in a laboratory. In version 2 and later, this system has been simplified and replaced by a single, logical column called "grab_sample".

Value

Returns a vector of two-character prefixes. If x is not prefixed, returns an error.

Author(s)

Spencer Rhea

Mike Vlah, vlahm13@gmail.com

Wes Slaughter

See Also

ms_drop_var_prefix_()

Examples

macrosheds_vars <- c('GN_NO3_N', 'GN_Mg', 'IS_discharge')
macrosheds_prefixs <- extract_var_prefix(x = macrosheds_vars)

MacroSHEDS/macrosheds documentation built on Oct. 30, 2024, 11:15 a.m.