D
D
danbanan2018-05-09 10:29:26
R
danbanan, 2018-05-09 10:29:26

What will help display the names of the regions in RStudio?

In general, the code with which I work.

library(maptools)
setwd("C:/kaz/gadm")
map.kz <- rgdal::readOGR("gadm34_KAZ_1.shp") #использую шейп-файлы
slotNames(map.kz)
[email protected]
str([email protected])
[email protected]$NAME_1
spplot(map.kz,
       "NAME_1", 
       scales = list(draw = T), 
       col.regions = heat.colors(n = 16) ) 
[email protected]$Persent <- c(88.9, 72.4, 83.7, 75.0,  #тут данные статистики
                         78.7, 75.0, 75.6, 84.9,
                         74.3, 87.8, 79.4, 77.1,
                         81.9, 73.2)

mypalette <- colorRampPalette(c("purple", "white")) #настроила цвет для хороплета
mypalette
function (n) 
{
  x <- ramp(seq.int(0, 1, length.out = n))
  rgb(x[, 1L], x[, 2L], x[, 3L], maxColorValue = 255)
}
spplot(map.kz, "Persent",
       col.regions = mypalette(20), 
       col = "transparent", 
       par.settings = list(axis.line = list(col = NA)))

And now how can you name the regions of the country?
5af2a31cad170187660199.jpeg
I took an example from this site:

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmshar, 2018-05-09
@dmshar

Look here

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question