The function applies a scheme to a data.frame or a sf object, which consists
in keeping only variables that should be kept, renaming variables, and
setting the type of variables.
Usage
apply_scheme(x, scheme, selection = NULL, name_origin = NULL)
Arguments
- x
data.frame or sf, data to be adapted.
- scheme
data.frame, scheme to be applied.
- selection
list, for big scheme a way to select entries. See details
- name_origin
character, when different 'name_origin' are provided, a
way to select the good one.
Value
data adapted, keeping geometry for 'sf' objects.
Details
'selection' should be a named list of vector, the name giving the column
where to perform the selection.
'name_origin' should be a character pattern that will help to select between
different possibilities in column names starting with "name_origin" in
scheme. The simplest, the best.