Skip to content

Commit

Permalink
Handle nested covariates
Browse files Browse the repository at this point in the history
  • Loading branch information
mattfidler committed Sep 4, 2024
1 parent 2b39f57 commit 98696c6
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions R/def2ini.R
Original file line number Diff line number Diff line change
Expand Up @@ -293,22 +293,26 @@
.coef <- lapply(.n, function(n) {
.cur <- .var[[n]]
if (!is.null(.cur$coef)) {
.coef <- .cur$coef[[1]]
lapply(.coef, function(var) {
.val <- .parsGetValue(pars, var)
## .val <- .parsTransformValue(.val, .cur$distribution,
## min=.cur$min, max=.cur$max)
## if (is.na(.val) && .inNaVal) {
## stop("transformed value of initial estimate for ", .var,
## " is not in correct range",
## call.=FALSE)
## }
if (.parsGetFixed(pars, var)) {
bquote(.(str2lang(var)) <- fixed(.(.val)))
} else {
bquote(.(str2lang(var)) <- .(.val))
}
})
.v <- lapply(seq_along(.cur$coef), function(i) {
.coef <- .cur$coef[[i]]
lapply(.coef, function(var) {
.val <- .parsGetValue(pars, var)
## .val <- .parsTransformValue(.val, .cur$distribution,
## min=.cur$min, max=.cur$max)
## if (is.na(.val) && .inNaVal) {
## stop("transformed value of initial estimate for ", .var,
## " is not in correct range",
## call.=FALSE)
## }
if (.parsGetFixed(pars, var)) {
bquote(.(str2lang(var)) <- fixed(.(.val)))
} else {
bquote(.(str2lang(var)) <- .(.val))
}
})
})
.v <- do.call(`c`, .v)
.v
} else {
NULL
}
Expand Down

0 comments on commit 98696c6

Please sign in to comment.