mhunter1 / dynr

Dynamic Modeling in R
5 stars 6 forks source link

Catch missing list of formulas first argument in `prep.formulaDynamics` #241

Closed mhunter1 closed 4 years ago

mhunter1 commented 4 years ago

Original report by Michael Hunter (Bitbucket: mhunter, GitHub: mhunter).


This

dy <- prep.formulaDynamics(
    x ~ xdot,
    xdot ~ eta_x*x + zeta_x*xdot + gamma_y*y + gamma_ydot*ydot,
    y ~ ydot,
    ydot ~ eta_y*y + zeta_y*ydot + gamma_x*x + gamma_xdot*xdot
)

produces

Error in as.list(fml)[[2]] : subscript out of bounds

instead of something helpful like

The formulas need to be put together in a list, smarty pants.