我不熟悉plotRGB
,但它也属于具有raster
相同功能的包,在ascolNA
中进行了描述。?colNA
"color for the background (NA values)"
library(raster)
#simulating missing values
tg<-matrix(1:15,nrow=3)
tg[2,3]<-NA
tg[1,5]<-NA
#rasterize
tg_raster<-raster(tg)
#normal plot
plot(tg_raster)
#replace NAs with blue color
plot(tg_raster,colNA="blue")
Run Code Online (Sandbox Code Playgroud)