Description Usage Arguments Value Examples
View source: R/raster_subsetByPolygon.R
This function subsets a raster object using cookie cutter
defined by polygon
. All cells within the polygon are returned.
1 | raster_subsetByPolygon(raster = NULL, polygon = NULL)
|
raster |
Raster\* object. |
polygon |
Spatial\* object. |
A Raster* object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | ## Not run:
library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')
# Load model data
rasterList <- raster_load(
modelName = "PNW-4km",
modelRun = c(2020091300, 2020091400, 2020091500, 2020091600),
xlim = c(-125, -116.5),
ylim = c(42, 46.2)
)
library(MazamaSpatialUtils)
setSpatialDataDir("~/Data/Spatial")
loadSpatialData("USCensusStates")
OregonList <- raster_subsetByPolygon(
rasterList,
polygon = subset(USCensusStates, stateCode == "OR")
)
raster_ggmap(
OregonList,
palette = "Spectral",
breaks = c(-1, 0, 4, 8, 16, 32, 64, 128, Inf),
direction = -1
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.