R/estimateConstrainedThetas.R

Defines functions estimateConstrainedThetas

estimateConstrainedThetas <- function(totalThetas = totalThetas, cleanConstraints = cleanConstraints) {
  X <- vector(mode = "list", length = nrow(cleanConstraints))
  # build up expression and then evaluate
  for (i in 1:nrow(cleanConstraints)) {
    X[[i]] <- rlang::expr(totalThetas[[!!cleanConstraints[i, "upper"]]] > totalThetas[[!!cleanConstraints[i, "lower"]]])
  }
  Y <- purrr::reduce(X, ~ rlang::expr(!!.x & !!.y))
  eval(Y)
}

Try the quid package in your browser

Any scripts or data that you put into this service are public.

quid documentation built on Dec. 9, 2021, 9:06 a.m.