Skip to contents

Returns a tibble with mutation data of Swiss municipalities. The data describes all changes related to the municipalities made between start_date and end_date.

Usage

mutations(
  start_date = NULL,
  end_date = NULL,
  incl_territory_exchange = FALSE,
  use_cache = TRUE,
  max_cache_age = "1 day"
)

Arguments

start_date

Begin of the period the data covers. A date or a character scalar in the format "YYYY-MM-DD".

end_date

End of the period the data covers. A date or a character scalar in the format "YYYY-MM-DD".

incl_territory_exchange

Include information (additional rows) about territory exchanges within and between municipalities.

use_cache

Whether or not to return cached results if possible. If FALSE, results are always newly fetched regardless of max_cache_age.

max_cache_age

Duration after which cached results are refreshed (i.e. newly fetched). A valid lubridate duration. Use Inf to disable cache expiry. Only relevant if use_cache = TRUE. Defaults to 1 day (24 hours).

Value

A tibble.

Examples

swissmuni::mutations(start_date = "2020-01-01",
                     end_date = "2020-06-30",
                     incl_territory_exchange = TRUE)
#> # A tibble: 18 × 14
#>    MutationNumber MutationDate InitialHistoricalCode InitialCode InitialName         InitialParentHistori…¹ InitialParentName InitialStep TerminalHistoricalCode
#>             <int> <date>                       <int>       <int> <chr>                                <int> <chr>                   <int>                  <int>
#>  1           3920 2020-01-01                   15297         873 Kirchenthurnen                       10288 Verwaltungskreis…          29                  16128
#>  2           3920 2020-01-01                   15298         874 Lohnstorf                            10288 Verwaltungskreis…          29                  16128
#>  3           3920 2020-01-01                   15300         876 Mühlethurnen                         10288 Verwaltungskreis…          29                  16128
#>  4           3921 2020-01-01                   15334         937 Schwendibach                         10289 Verwaltungskreis…          29                  16129
#>  5           3921 2020-01-01                   15336         939 Steffisburg                          10289 Verwaltungskreis…          26                  16129
#>  6           3922 2020-01-01                   15366         981 Niederbipp                           10286 Verwaltungskreis…          26                  16130
#>  7           3922 2020-01-01                   15378         996 Wolfisberg                           10286 Verwaltungskreis…          29                  16130
#>  8           3923 2020-01-01                   15541        1123 Altishofen                           10302 Wahlkreis Willis…          26                  16131
#>  9           3923 2020-01-01                   15553        1126 Ebersecken                           10302 Wahlkreis Willis…          29                  16131
#> 10           3924 2020-01-01                   13268        2111 Villaz-Saint-Pierre                  10106 District de la G…          29                  16132
#> 11           3924 2020-01-01                   14513        2116 La Folliaz                           10106 District de la G…          29                  16132
#> 12           3925 2020-01-01                   11633        2185 Corserey                             10104 District de la S…          29                  16133
#> 13           3925 2020-01-01                   12550        2213 Noréaz                               10104 District de la S…          29                  16133
#> 14           3925 2020-01-01                   13103        2221 Prez-vers-Noréaz                     10104 District de la S…          29                  16133
#> 15           3926 2020-01-01                   16027        3901 Chur                                 10314 Region Plessur             26                  16134
#> 16           3926 2020-01-01                   16028        3926 Maladers                             10314 Region Plessur             29                  16134
#> 17           3927 2020-01-01                   14376        4114 Schinznach-Bad                       10023 Bezirk Brugg               29                  16135
#> 18           3927 2020-01-01                   15387        4095 Brugg                                10023 Bezirk Brugg               26                  16135
#> # ℹ abbreviated name: ¹​InitialParentHistoricalCode
#> # ℹ 5 more variables: TerminalCode <int>, TerminalName <chr>, TerminalParentHistoricalCode <int>, TerminalParentName <chr>, TerminalStep <int>