Description Usage Arguments Details Value Examples
View source: R/match_pattern.R
match_pattern
compares one column of a data frame against a list of
pattern.
1 | match_pattern(df, colname, lst_pattern, strict = TRUE)
|
df |
a data frame. |
colname |
a character string specifying the colonne to compare against the list of pattern. |
lst_pattern |
a named list of pattern, should contains one or multiple vector. Each slot should be named. |
strict |
a boolean to indicate if the character string should match only some value in the vector (FALSE) or all values (TRUE) on the list of pattern. |
lst_pattern
can contains multiple vector of pattern. The column
selected is compared to each vector contained in the list pattern and
return the name of the slot with the vector without any difference.
match_pattern
In case of a matching, the function will return
a character vector, if not, it will return NULL
1 2 3 4 5 6 7 | # To look at the year of expression of the province in Vietnam from the
# imhen data sets (meteorological data)
library(imhen)
df <- imhen::meteo_intagg_2008_2017 # get data for the years 2008-2017
# Allows to check the spatial expression is corresponding to the year
match_pattern(df, "province", vn_admin1_year)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.