random_countries {countries} | R Documentation |
Output random country names
Description
This function returns the mode of vectors. That is to say, for any given vector of values, it returns the value that appears most frequently.
The function works with strings, numerical and mixed inputs. NA
values are treated as distinct values.
Usage
random_countries(n, replace = FALSE, nomenclature = "name_en", seed = NULL)
Arguments
n |
Number of desired (pseudo)random country names. |
replace |
Logical value indicating whether sampling should be with replacement. |
nomenclature |
Nomenclature from which the list of countries should be taken. Not all countries are present in all nomenclature, for example Taiwan is not recognised by the UN, so it will not be returned with |
seed |
Single numerical value to be used as seed. |
Value
A vector of n (pseudo)random country names.
See Also
Examples
random_countries(10)
random_countries(n = 500, replace = TRUE)
random_countries(n = 5, nomenclature = "ISO3", seed = 5)