billdenney/pknca

Is there a convenient way to extract input units from pknca.

john-harrold opened this issue · 4 comments

So I want to extract the supplied units when running pk.nca(). For example if nca_res below is the output from pk.nca() I'm currently doing something like this to extract the time units supplied:

time_units = nca_res$data$units[nca_res$data$units$PPTESTCD == "start", ][["PPORRESU"]]

But I don't think that would be ideal if say I did unit conversions somewhere along the way.

That is the correct way to get the input units. If there are conversions, then they would be stored in the "PPSTRESU" column, and the conversion is in the "conversion_factor" columns of the same data frame where "PPORRESU" is stored.

Does that answer the question?

facepalm Sorry I misread the documentation :).

All good 😊

If the docs could be clarified, lemme know (PRs accepted!)