I've got two rasters, soil
and slope
. I want to plot the slope
raster but only in areas where there is soil
(i.e. soil is > 0). How can I do this?
This is the soil
raster:
EDIT 1: more information about the rasters.
soil
> extent(soil)
class : Extent
xmin : -180
xmax : 179.9856
ymin : -60
ymax : 89.994
> res(soil)
[1] 0.008333 0.008333
> origin(soil)
[1] 0.001133 -0.002400
slope
> extent(slope)
class : Extent
xmin : -180
xmax : 180.0023
ymin : -56.00016
ymax : 84.00257
> res(slope)
[1] 0.008333386 0.008333496
> origin(slope)
[1] 0.0011330 0.0009332
EDIT 2: information about dimensions
> dim(soil)
[1] 18000 43200 1
> dim(slope)
[1] 16800 43200 1