conditional statements in IC block
Hi Pmetrics team,
I am running into an issue with the dev build (last downloaded today) when trying to run conditional statements in the initial conditions block. I get the same error when loading a model from a text file or coding in the rscript. For example,
txt
#Ini
X(1) = IC1
&IF(IC == 0) X(1) = 0
X(2) = IC*V
Rscript
ini = list( "X[1] = IC1", "IF(IC == 0) X[1] = 0", "X[2] = IC*V")
After loading data file etc and trying to execute NPAG returns
Error in append(lines, if (is.null(names[i]) || nchar(names[i]) == 0) { : Error: No equation number detected for initial conditions: IF(IC == 0) X[1] = 0
It is working fine in 2.0.2. Flagging for info.
Many thanks, Richard
That looks like a bug indeed, but I'm also curious why you need the IF statement, and are IC1 and IC different or is that a typo?
Thank you, Michael. I'm combining two datasets, one with observed dose times and one with no observed dose times but with a pre-dose total level. So have set IC1 (free drug) as a primary variable and IC (total drug) as a covariate in the dataframe (zeroing it off for patients in the observed dose time group).