You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(term)
expr<-"for (i in 1:nObs) { log(eCount[i]) <- b0 + bYear * Year[i] + bKelpLine * KelpLine[i]}"
pars(expr)
#> Error in `term_impl()` at term/R/term.R:50:4:#> ! All elements of term vector `string_args_term` must be valid.#> Backtrace:#> ▆#> 1. ├─universals::pars(expr)#> 2. └─term:::pars.character(expr)#> 3. └─term::term(x) at term/R/pars.R:39:2#> 4. └─term:::term_impl(args) at term/R/term.R:50:4#> 5. └─term::chk_term(string_args_term, "valid") at term/R/internal.R:67:2#> 6. └─chk::abort_chk("All elements of term vector ", x_name, " must be valid") at term/R/chk.R:25:4#> 7. └─chk::err(..., n = n, tidy = tidy, class = "chk_error", call = call)#> 8. └─rlang::abort(msg, class = class, !!!args[named], call = call)mbr:::pars.character(expr)
#> [1] "b0" "bKelpLine" "bYear" "eCount" "i" "KelpLine" #> [7] "log" "nObs" "Year"
Yes there is an exported terms::pars.character() that treats the input as a term vctr and an internal mbr:::pars.character() that treats the input as model code.
I was thinking that the mbr function would be hidden. We could rename it as its internal to avoid confusion?
The Bug
This gave me pause when working on poissonconsulting/mcmcderive#2 .
A Reprex
Created on 2023-05-30 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: