readShapeSpatial
我希望在 .shp using函数上使用背景颜色。任何人都可以帮助我吗?是否有任何类似的功能(除了readShapePoly
:)可用于为 .shp 文件添加背景颜色?
这是我的代码的一部分...
library(raster)
library(maptools)
library(mapdata)
library(maps)
library(scales)
pcontorta <- readShapeSpatial("PER_water_areas_dcw.shp")
pcontorta2 <- readShapeSpatial("BOL_water_areas_dcw.shp")
pcontorta3 <- readShapeSpatial("ECU_water_areas_dcw.shp")
pcontorta4 <- readShapeSpatial("PRY_water_areas_dcw.shp")
pcontorta5 <- readShapeSpatial("PER_adm2.shp")
pcontorta6 <- readShapeSpatial("BOL_adm2.shp")
pcontorta7 <- readShapeSpatial("ECU_adm2.shp")
pcontorta8 <- readShapeSpatial("PRY_adm2.shp")
read.csv("coord.csv") -> data
Data <- data.frame(data[,1:4])
Data[Data$species=="B._nn",] -> primera
Data[Data$species=="B._ghn",] -> segunda
Data[Data$species=="B._bolivianus",] -> tercera
Data[Data$species=="B._brevirostris",] -> cuarta
Data[Data$species=="B._diasphanus",] -> quinta
Data[Data$species=="B._osgoodi",] -> sexta
Data[Data$species=="B._pachacuti",] -> septima
Data[Data$species=="B._phoenicoteru",] -> octava
Data[Data$species=="B._pectinatus",] -> novena
Data[Data$species=="B._peruanus",] -> decima
Data[Data$species=="B._thomasi",] -> once
rownames(Data) <- data[,1]
attach(Data)
na.omit(Data) -> Data
alt <- raster("alt.bil")
extent_all <-extent (-85, -50, -30, 5)
crop(alt, extent_all)->alt
tiff(filename = "Mapa.tiff",res = 800, pointsize = 6, width = 3200, height = 3200, units = "px")
#...
#Continues a little bit...plotting...
box()
dev.off()
感谢,并有一个愉快的一天!