spplot을 사용하여 shapefile을 플롯합니다. 속성 값에 따라 shapefile의 각 포인트에 다른 색상을 지정해야합니다.R - spplot을 사용하여 점을 그릴 때 커팅 값을 사용자 정의 할 수 없음
내 shapefile 속성 테이블은 다음과 같습니다 : Attribute_Table. 가을, 겨울, 봄, 여름의 값에 따라 포인트를 플롯해야합니다 (총 4 개의 플롯이 있습니다. 각 시즌마다 1 개씩). 나는이 음모를 얻기
# Defining point size
point_size = 0.8
# Defining where cuts are
classes_R = seq(-1,1,0.05)
# Defining color of scale bar
my.palette_R = brewer.pal(n = 10, name = "RdBu")
spplot(r_values, zcol = c("Fall","Winter","Spring","Summer"), do.log = F,as.table = T,
pch = 20, cex = point_size, key.space = "right", col.regions = my.palette_R,
main = "R Values - P Model", colorkey = T, at=classes_R,
sp.layout=(list(new_layer_1,new_layer_2))) #sp.layout is for 2 other layers (you can see the states in gray and the lakes in blue in backround
:이 코드를 실행하여
(r_values 내 Shape 파일입니다) Plot.
classes_R에서 컷 (클래스)을 변경해도 결과 플롯이 변경되지 않습니다.
내가 얻고 자하는 것은 매 0.05에서 -1에서부터 +1까지 범위가있는지도와이 절단이있는 눈금 막대 오른쪽에있는 레이블입니다.
다음은 일부 데이터가있는 Excel 파일을 다운로드하는 링크입니다. 이 점
https://drive.google.com/open?id=1WPyS5TFGCxBDNhJIJc_jKvFmJd5hthl4
코드를 재현 할 수 있도록 작은 테스트 데이터 세트에 대한 액세스를 제공 할 수 있습니까? 또한 0.05의 범위에서 2로 잘라 내기를 원하면 40 색이 필요합니다. [여기] (http://www.nickeubank.com/wp-content/uploads/2015/10/RGIS3_MakingMaps_part1_mappingVectorData.html#controlling-color-breaks) 및 [여기] (http : //rspatial.r- forge.r-project.org/gallery/)에서 귀하의 질문에 답변하는지 확인하십시오. – Kamil
@Kamil 일부 데이터와 각 점의 좌표가있는 Excel 파일을 추가했습니다. –