Skip to contents

This function generates a vector of fictional country names. While the generated names are designed to resemble real country names, the results will not match (at least not exactly) country names from the library provided. Please note that the function is still experimental.

The names are generated using a Markov chain approach based on syllable patterns found in a library of real country names. The function generate_states() uses the syllabise_states() function to split existing country names into syllable-like units, providing special attention to common patterns in country names such as "land", "stan", "burg", and others. A transition matrix is then built from these syllable units, allowing for the generation of new names that mimic the structure and length of real country names. Checks are included to ensure that the generated names are unique, do not match any existing country names, and avoid certain uncommon patterns such as ending on a preposition.

If no library of country names is provided, the function defaults to using a comprehensive list of country names from the {manystates} package. However, users can supply their own list of country names to customize the generation process.

This function can be useful for creating fictional datasets for testing, illustrative, or pedagogical purposes. For example, it can be used in classroom exercises that rely on invented country names, such as in-class simulations of international relations or negotiation, role-playing scenarios, or mock data analysis tasks. Using fictional country names helps avoid any unintended bias or preconceptions associated with real countries. Or they can be used in creative writing or game design. The names might inspire fictional settings or entities in stories, games, or other creative works. Each name could inspire a unique culture, conflict, or mythology. Writers could use them to kickstart short stories, while game designers might build entire maps or quests around them.

Usage

generate_states(n = 10, countries = NULL)

syllabise_states(word)

syllabize_states(word)

Arguments

n

Integer number of country names to generate from a library of fictional country names. Default is 10.

countries

Optional string vector of country names to use as a library for generating fictional names.

word

One or more words (character vector) to split into syllable-like units.

Value

String vector of fictional country names

Examples

  generate_states(12)
#>  [1] "Blique Duchy E-Homburg"               
#>  [2] "Sint"                                 
#>  [3] "Choson"                               
#>  [4] "Kitts Main The Lemy Cote France"      
#>  [5] "Tonk Sabarbuda"                       
#>  [6] "Nis Confoederate Darfur The Urambo Eu"
#>  [7] "Shwa"                                 
#>  [8] "Loum Of Duchy"                        
#>  [9] "Mtetwa Arab"                          
#> [10] "Zaire Kloengkoeng Of Mcdonald"        
#> [11] "Den Te South Li Phi"                  
#> [12] "Ssoulou"                              
  syllabise_states("Afghanistan")
#> [1] "af"   "gha"  "ni"   "stan"
  syllabise_states("Saint Pierre and Miquelon")
#>  [1] "saint" " "     "pie"   "rre"   " "     "and"   " "     "mi"    "que"  
#> [10] "lon"