Skip to contents

Convert to cities at different points in time

Usage

city_convert(city, from, to)

Arguments

city

A jpcity_city object.

from

A character (year, month, and day components) or date-time object of the starting date.

to

A character (year, month, and day components) or date-time object of the ending date.

Value

A list of a jpcity_city object.

Examples

city <- parse_city(c("01201", "01202"))
#> Guessing the interval to be 1970-04-01 JST--1972-03-31 JST.
#>  You can override using `when` argument.
city_convert(city,
             from = "1970-04-01",
             to = "2020-01-01")
#> [[1]]
#> <city[1]> Interval: 1972-04-01--Inf
#> [1] 01100
#> 
#> Cities:
#>   city_code pref_name city_desig_name city_desig_name_kana city_name
#> 1     01100    北海道          札幌市           さっぽろし          
#>   city_name_kana
#> 1               
#> 
#> [[2]]
#> <city[1]> Interval: 1970-04-01--Inf
#> [1] 01202
#> 
#> Cities:
#>   city_code pref_name city_desig_name city_desig_name_kana city_name
#> 1     01202    北海道                                         函館市
#>   city_name_kana
#> 1     はこだてし
#>