metrumresearchgroup / mrgsolve

Simulate from ODE-based population PK/PD and QSP models in R
https://mrgsolve.org
129 stars 36 forks source link

Add replace() function to evtools #1203

Closed kylebaron closed 2 months ago

kylebaron commented 2 months ago

Summary

To date, the evtools plugin has been able to quickly create and give doses given as bolus() or infuse().

This PR implements an equivalent function to replace() the amount in a specific compartment with a new amount. This is accomplished via evid 8 (already-existing functionality).

The basic setup is similar to bolus() and infuse(): we provide two overloaded replace() functions, one that gets the self object first (this will create and "send" the dose in one function call) and another replace() function that will create the object and return it to the user for further config.