Detect countries names

geoparser(x)

Arguments

x

a character in which countries will be detected.

Value

A data.frame with the following four columns:

  • geographic_entity: the name of the country

  • n_pages: the total number of pages in the document

  • page: the page number

  • count: the occurrence of the country name for a given page

Examples

## Example document ----
texte <- c(
  "
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
  tempor incididunt US labore et dolore magna aliqua. USA enim ad minim 
  veniam, quis nostrud exercitation ullamco laboris United States
  ",
  "
  Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 
  tempor incididunt US labore et dolore magna aliqua. USA enim ad minim 
  veniam, quis nostrud exercitation ullamco laboris Canada.
  "
)

## Detect countries ----
geoparser(texte)
#>   geographic_entity n_pages page count
#> 1     United States       2    1     3
#> 2            Canada       2    2     1
#> 3     United States       2    2     2