I have raster data for whole world (filename.bil) and a Shapefile (filename.shp) for USA. How to draw map for USA by using the raster data (filename.bil) in R plot?
shape <- shapefile(file.path(gadmdir,"gadm36_USA_1.shp”))
b <- brick(file.path(gaezdir, "plate47.bil"))
r <- raster(shape, res=0.0833333 )
values(r) <- 1:ncell(r)
cropextent <- mask(r, shape)
plot(cropextent)