본문 바로가기
연구 노트/개발환경 구축

R package :: rnaturalearth 저작권 free

by Dr. STEAM 2023. 5. 31.
반응형

지도 저작권 없는 세계지도 데이터 

 

Drawing beautiful maps programmatically with R, sf and ggplot2 — Part 1: Basics (r-spatial.org)

 

Drawing beautiful maps programmatically with R, sf and ggplot2 — Part 1: Basics

view raw Rmd EDIT: Following a suggestion Adriano Fantini and code from Andy South, we replaced rworlmap by rnaturalearth. This tutorial is the first part in a series of three: In this part, we will cover the fundamentals of mapping using ggplot2 associate

r-spatial.org

 

R에서 사용하기 위해 사전에 설치할 패키지들

install.packages("rnaturalearth")

# 아래 패키지 설치에 시간이 많이 걸린다.
install.packages("ggspatial")  
install.packages("sf")
install.packages("s2")

 

예제 코드 

 

library("ggspatial")
ggplot(data = world) +
    geom_sf() +
    annotation_scale(location = "bl", width_hint = 0.5) +
    annotation_north_arrow(location = "bl", which_north = "true", 
        pad_x = unit(0.75, "in"), pad_y = unit(0.5, "in"),
        style = north_arrow_fancy_orienteering) +
    coord_sf(xlim = c(-102.15, -74.12), ylim = c(7.65, 33.97))

## Scale on map varies by more than 10%, scale bar may be inaccurate

 

 

 

 

 

rnaturalearth package - RDocumentation

 

rnaturalearth package - RDocumentation

install_rnaturalearthhires

www.rdocumentation.org

 

 

 

 

728x90
반응형