Home>

Using the Ministry of Land, Infrastructure, Transport and Tourism national land numerical data (http://nlftp.mlit.go.jp/ksj/gml/datalist/KsjTmplt-C23.html) However, a part of the inland will be painted black.

# Load package
library (rgdal)
library (dplyr)
library (broom)
library (ggplot2)
#shp file reading
ogrListLayers ("tokyo")
tcoast<-readOGR ("tokyo", "C23-06_13-g_Coastline")
ogrListLayers ("kanagawa")
kcoast<-readOGR ("kanagawa", "C23-06_14-g_Coastline")
ogrListLayers ("chiba")
ccoast<-readOGR ("chiba", "C23-06_12-g_Coastline")
Transformation to #tidy
tc<-tidy (tcoast)
tcdata<-tcoast @ data%>%
  tibble :: rownames_to_column ("id")%>%
  inner_join (tc, by = "id")
kc<-tidy (kcoast)
kcdata<-kcoast @ data%>%
  tibble :: rownames_to_column ("id")%>%
  inner_join (kc, by = "id")
cc<-tidy (ccoast)
ccdata<-ccoast @ data%>%
  tibble :: rownames_to_column ("id")%>%
  inner_join (cc, by = "id")
#Illustration
pdef<-ggplot (NULL) +
  coord_quickmap () +
  theme (panel.background = element_rect (fill = "transparent", color = "black"),
        panel.grid = element_blank (),
        legend.position = "none")
ptc<-geom_line (data = tcdata, aes (long, lat, group = group), color = "black")
pkc<-geom_line (data = kcdata, aes (long, lat, group = group), color = "black")
pcc<-geom_line (data = ccdata, aes (long, lat, group = group), color = "black")
pdef + ptc + pkc ​​+ pcc + xlim (139, 141) + ylim (34.9, 35.8)


  • Answer # 1

    Can I usegeom_path ()?

  • Answer # 2

    I want to check the definition ofgeom_linemyself. It looks like a function for a line graph (data is ascending in x-axis).
    Rather than being filled, I think that the line where the dots move up and down when viewing the data in ascending order on the x-axis is connected.