Skip to contents

Aggregates and combines registration inflow and outflow data.

Usage

get_regflow(iso = NULL)

Arguments

iso

Optional character. ISO3 country code to filter the data by geography. If NULL (default), returns data for all geographies.

Value

A data frame with columns geo, t, n, and var, where var indicates whether the count is "Entries" or "Exits".

Examples

# Get all regional flows
all_flows <- get_regflow()

knitr::kable(head(all_flows,5))
#> 
#> 
#> |geo |t        |       n|var     |
#> |:---|:--------|-------:|:-------|
#> |ARG |2023 Jan | 1993127|Entries |
#> |ARG |2023 Feb | 1933049|Entries |
#> |ARG |2023 Mar | 1881628|Entries |
#> |ARG |2023 Apr | 1882274|Entries |
#> |ARG |2023 May | 1749469|Entries |

# Get flows for USA only
usa_flows <- get_regflow("USA")

knitr::kable(head(usa_flows,5))
#> 
#> 
#> |geo |t        |      n|var   |
#> |:---|:--------|------:|:-----|
#> |USA |2022 Jan | 381231|Exits |
#> |USA |2022 Feb | 288707|Exits |
#> |USA |2022 Mar | 401961|Exits |
#> |USA |2022 Apr | 381597|Exits |
#> |USA |2022 May | 351002|Exits |