File: coef.ecoNP.R

package info (click to toggle)
r-cran-eco 4.0-1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 772 kB
  • sloc: ansic: 4,214; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 465 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
coef.ecoNP <- function(object, subset = NULL, obs = NULL, ...) {
  mu <- object$mu
  if (is.null(subset))
    subset <- 1:nrow(mu)
  else if (max(subset) > nrow(mu))
    stop(paste("invalid input for `subset.' only", nrow(mu), "draws are stored."))

  if (is.null(obs))
    obs <- 1:dim(object$mu)[3]
  else if (max(subset) > dim(object$mu)[3])
    stop(paste("invalid input for `obs.' only", dim(object$mu)[3], "draws are stored."))
  
  return(mu[subset,,obs])
}