make_lookup_vector: Create a lookup table from a data.frame

Description Usage Arguments Value

View source: R/make_site_name.R

Description

Sometimes one column of a data.frame has human-readable names, and the other had computer-useful codes. We often need to look up one based on the other. This function creates a handy lookup vector from two such columns of a data.frame. The vector is only as long at the number of distinct name-value pairs.

Usage

1
make_lookup_vector(some_df, value_col, name_col)

Arguments

some_df

any data frame, containing two columns: one for values, one for names used to choose a value

value_col

the values to be looked up

name_col

the names to use to find these values.

Value

a named vector of


ReseauBiodiversiteQuebec/mapselector documentation built on Feb. 22, 2022, 3:13 p.m.