subFrame | R Documentation |
This function returns an "scrFrame" object containing only those sessions identified by "subs".
subFrame(scrFrame, subs)
scrFrame |
An scrFrame which will be subsetted. Must be of class 'scrFrame'. |
subs |
A numeris vector indicating which of the sessions are to be retained. |
An exact copy of the supplied scrFrame for only those session identified using the "subs" argument.
##---- 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 (scrFrame, subs)
{
nms <- names(scrFrame)
nms <- setdiff(nms, c("nocc", "type"))
miss.nms <- setdiff(c("caphist", "traps", "trapCovs", "indCovs",
"trapOperation"), nms)
scrFrame.sub <- list()
for (i in nms) {
scrFrame.sub[[i]] <- list()
if (is.null(scrFrame[[i]])) {
scrFrame.sub[[i]] <- NULL
}
else {
for (j in 1:length(subs)) {
scrFrame.sub[[i]][[j]] <- scrFrame[[i]][[subs[j]]]
}
}
}
for (i in miss.nms) {
scrFrame.sub[[i]] <- NULL
}
new.nocc <- max(unlist(lapply(scrFrame.sum$caphist, function(x) dim(x)[3])))
scrFrame.sub$nocc <- scrFrame$nocc
scrFrame.sub$type <- scrFrame$type
class(scrFrame.sub) <- "scrFrame"
return(scrFrame.sub)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.