View source: R/cleaning_standardizing_preprocessing_functions.R
clean_country_iso | R Documentation |
Cleans the dataset actors' countries using exact matches based
on the package's country dictionary and adds corresponding iso information to
the dataset. For more information on clean_enc
, see the vignette.
clean_country_iso(dataset, country.dict, iso = 3, clean_enc = T)
dataset |
Dataset to clean the country names for |
country.dict |
Country dictionary to clean the dataset against |
iso |
Input either 2 or 3 to select for 2 or 3 letter ISO code. Defaults to ISO3 |
clean_enc |
Is the data read in with the correct encoding? If unknown, set as FALSE. Defaults to TRUE |
The clean_enc
argument is used for users to denote whether the data is
read in with the correct encoding. Use clean_enc = T
if users are sure of the encoding
that the data is in and is sure data is read in with the right encoding and
clean_enc = F
if users are unsure of data's encoding or if unsure if data is read in
with the correct encoding.
If clean_enc = F
, then the function will check the encoding of the country column in
the user's dataset and tries to fix it if the data was read in with the wrong encoding
(with rvest::repair_encoding()
).
The original dataset with the country names cleaned
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.