rename_fude()
renames the 6-digit local government code of the list
returned by read_fude()
to the corresponding Japanese name in order to
make the data human-friendly.
Arguments
- data
List of
sf::sf()
objects.- suffix
logical. If
FALSE
, suffixes such as "SHI" and "KU" in local government names are removed.- romaji
If not
NULL
, rename the local government name in romaji instead of Japanese. Romanji format is upper case unless specified."title"
: Title case."lower"
: Lower case."upper"
: Upper case.
- quiet
logical. Suppress information about the data to be read.
Value
A list of sf::sf()
objects.
Examples
path <- system.file("extdata", "castle.zip", package = "fude")
d <- read_fude(path, stringsAsFactors = FALSE, quiet = TRUE)
d2 <- rename_fude(d)
#> 2021_382019 -> 2021_松山市
#> 2022_382019 -> 2022_松山市
#> 2022_382078 -> 2022_大洲市
d2 <- rename_fude(d, suffix = FALSE)
#> 2021_382019 -> 2021_松山
#> 2022_382019 -> 2022_松山
#> 2022_382078 -> 2022_大洲
d2 <- d |> rename_fude(romaji = "upper")
#> 2021_382019 -> 2021_MATSUYAMA-SHI
#> 2022_382019 -> 2022_MATSUYAMA-SHI
#> 2022_382078 -> 2022_OZU-SHI