Return different meshcode values included in the mesh.

mesh_convert(meshcode = NULL, to_mesh_size = NULL)

Arguments

meshcode

character. mesh code

to_mesh_size

target mesh type. From 80km to 0.125km. If NULL, the meshcode of one small scale will be returned. If it is the same as the original size, the meshcode of the input will be return.

Examples

mesh_convert(meshcode = "52350432", to_mesh_size = 80)
#> [1] "5235"
mesh_convert("52350432", 10)
#> [1] "523504"
# Scale down mesh_convert("52350432", 0.500)
#> [1] "523504321" "523504322" "523504323" "523504324"
mesh_convert("52350432", 0.250)
#> [1] "5235043211" "5235043212" "5235043213" "5235043214" "5235043221" #> [6] "5235043222" "5235043223" "5235043224" "5235043231" "5235043232" #> [11] "5235043233" "5235043234" "5235043241" "5235043242" "5235043243" #> [16] "5235043244"
mesh_convert(meshcode = "52350432", 0.125)
#> [1] "52350432111" "52350432112" "52350432113" "52350432114" "52350432121" #> [6] "52350432122" "52350432123" "52350432124" "52350432131" "52350432132" #> [11] "52350432133" "52350432134" "52350432141" "52350432142" "52350432143" #> [16] "52350432144" "52350432211" "52350432212" "52350432213" "52350432214" #> [21] "52350432221" "52350432222" "52350432223" "52350432224" "52350432231" #> [26] "52350432232" "52350432233" "52350432234" "52350432241" "52350432242" #> [31] "52350432243" "52350432244" "52350432311" "52350432312" "52350432313" #> [36] "52350432314" "52350432321" "52350432322" "52350432323" "52350432324" #> [41] "52350432331" "52350432332" "52350432333" "52350432334" "52350432341" #> [46] "52350432342" "52350432343" "52350432344" "52350432411" "52350432412" #> [51] "52350432413" "52350432414" "52350432421" "52350432422" "52350432423" #> [56] "52350432424" "52350432431" "52350432432" "52350432433" "52350432434" #> [61] "52350432441" "52350432442" "52350432443" "52350432444"
mesh_convert("523504323", 0.250)
#> [1] "5235043231" "5235043232" "5235043233" "5235043234"
mesh_convert("5235043213", 0.125)
#> [1] "52350432131" "52350432132" "52350432133" "52350432134"
mesh_convert("52350432", 1)
#> [1] "52350432"
mesh_convert("52350432131", 0.125)
#> [1] "52350432131"