Description Usage Format Details Examples
From 1958 to 2008. Longitude: 200W to 20E. Latitude: 0N to 90N.
1 2 3 4 5 6 7 8 9 |
raster brick
Can be the full data set (soda
), or the annual maximum or mean (soda.annMax
and soda.annMean
, respectively). Furthermore, soda.annMax.mu
and soda.annMean.mu
represent the long-term averages of their variables, such that "Max.mu" indicates the among-year average of within-year maxima, and "Mean.mu" similarly indicates the among-year average of the within-year average. Note that in the typical case where each year is comprised of the same number of observations, the long-term average could be taken all at once, rather than first being average within a year.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | depth.200 <- depth
d2v <- slot(slot(depth.200,'data'),'values')
# Set depths below 200m or above sea level to NA, shallower to 1
one_logic <- d2v <=0 & d2v >=-200
slot(slot(depth.200,'data'),'values')[one_logic] <- 1
slot(slot(depth.200,'data'),'values')[!one_logic] <- NA
temps.crop <- crop(soda.annMean, extent(depth.200)) # crop soda data to region for which depth data exist
plot(temps.crop[[1]])
# match up the resolution of depth and temp
# depth is coarser, so take its max as agg funct
t_res <- res(temps.crop)
d_res <- res(depth.200)
depth.200.coarse <- aggregate(depth.200, fact=(t_res/d_res), fun=max)
plot(depth.200.coarse)
# multiply the temperature by the 0m-200m depth logic
# i.e., multiply temps outside the 0m-200m depth range by NA, else by 1
temp.200 <- overlay(temps.crop, depth.200.coarse, fun="*")
names(temp.200) <- names(temps.crop)
plot(temp.200[[1]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.