japanmeshでメッシュコードから緯度経度を出す

  • japanmesh でメッシュコードから緯度経度をだしたい
  • その作業を tibble でやりたいとき
data  %>% 
  mutate(
    latitude = map_dbl(
      .x = mesh_code,
      .f = ~ {jpgrid::grid_to_coords(jpgrid::grid_auto(.x))[[2]]}
    ),
    longitude = map_dbl(
      .x = mesh_code,
      .f = ~ {jpgrid::grid_to_coords(jpgrid::grid_auto(.x))[[1]]}
    )
  ) 


data  %>% 
mutate(
     latitude = map_dbl(
       .x = mesh_code_3rd,
       .f = ~ {japanmesh::mesh_to_XY(japanmesh::mesh_auto(.x))[[2]]}
     ),
     longitude = map_dbl(
       .x = mesh_code_3rd,
       .f = ~ {japanmesh::mesh_to_XY(japanmesh::mesh_auto(.x))[[1]]}
     )
   )