R로 지리공간 데이터 시각화하기
Charlotte Wickham
Assistant Professor at Oregon State University
summary(countries_sp)
SpatialPolygons 클래스 객체
좌표:
min max
x -180 180.00000
y -90 83.64513
투영됨: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0]
summary(countries_spdf)
SpatialPolygonsDataFrame 클래스 객체
좌표:
min max
x -180 180.00000
y -90 83.64513
투영됨: FALSE
proj4string :
[+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84
+towgs84=0,0,0]
데이터 속성:
name iso_a3
길이:177 길이:177
클래스: character 클래스: character
모드 : character 모드 : character
str(countries_sp, max.level = 2)
'SpatialPolygons' 정식 클래스 [패키지 "sp"] — 슬롯 4개
..@ polygons :길이 177의 리스트
.. .. [list output truncated]
..@ plotOrder : int [1:177] 7 136 28 169 31 23 9 66 84 5 ...
..@ bbox : num [1:2, 1:2] -180 -90 180 83.6
.. ..- attr(*, "dimnames")=길이 2의 리스트
..@ proj4string:'CRS' 정식 클래스 [패키지 "sp"] — 슬롯 1개
str(countries_spdf, max.level = 2)
'SpatialPolygonsDataFrame' 정식 클래스 [패키지 "sp"] — 슬롯 5개
..@ data :'data.frame': 177 obs. of 6 variables:
..@ polygons :길이 177의 리스트
.. .. [list output truncated]
..@ plotOrder : int [1:177] 7 136 28 169 31 23 9 66 84 5 ...
..@ bbox : num [1:2, 1:2] -180 -90 180 83.6
.. ..- attr(*, "dimnames")=길이 2의 리스트
..@ proj4string:'CRS' 정식 클래스 [패키지 "sp"] — 슬롯 1개
# 1. 전용 메서드 사용
proj4string(countries_sp)
"+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0"
# 2. @ 뒤에 인용하지 않은 슬롯 이름 사용
countries_sp@proj4string
CRS arguments: +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
# 3. slot()에 슬롯 이름을 문자열로 전달
slot(countries_sp, "proj4string")
CRS arguments: +proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0
R로 지리공간 데이터 시각화하기