tensor_predictors/mvbernoulli/R/extract.R

13 lines
380 B
R
Raw Normal View History

#' Extract parts of an `mvbinary` data set
#'
#' @param obj object of class `mvbinary`
#' @param drop if true, the returned object is only a integer vector
#'
#' @return object of class `mvbinary`
#'
#' @export
`[.mvbinary` <- function(obj, i) {
# subset integer vector and set class and dimension attributes
structure(c(obj)[i], class = "mvbinary", p = attr(obj, "p"))
}