1 | Prepare_WCGBTS_Extrapolation_Data_Fn(strata.limits)
|
strata.limits |
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 | ##---- Should be DIRECTLY executable !! ----
##-- ==> Define data, use random,
##-- or do help(data=index) for the standard data sets.
## The function is currently defined as
function (strata.limits)
{
data(extrapolation_data)
Data_Extrap <- extrapolation_data
Tmp = cbind(BEST_DEPTH_M = (-1000) * Data_Extrap[, "Depth_km"],
BEST_LAT_DD = Data_Extrap[, "Lat"], propInWCGBTS = Data_Extrap[,
"propInWCGBTS"])
a_el = as.data.frame(matrix(NA, nrow = nrow(Data_Extrap),
ncol = nrow(strata.limits), dimnames = list(NULL, strata.limits[,
"STRATA"])))
for (l in 1:ncol(a_el)) {
a_el[, l] = apply(Tmp, MARGIN = 1, FUN = nwfscDeltaGLM::strata.fn,
Strata.df = strata.limits[l, ])
a_el[, l] = ifelse(is.na(a_el[, l]), 0, 4 * Data_Extrap[,
"propInWCGBTS"])
}
tmpUTM = Convert_LL_to_UTM_Fn(Lon = Data_Extrap[, "Lon"],
Lat = Data_Extrap[, "Lat"])
Data_Extrap = cbind(Data_Extrap, Include = (Data_Extrap[,
"Cowcod"] == 0 & Data_Extrap[, "Ngdc_m"] < (-35)))
Data_Extrap[, c("E_km", "N_km")] = tmpUTM[, c("X", "Y")]
Return = list(a_el = a_el, Data_Extrap = Data_Extrap)
return(Return)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.