hallowkm / RxODE

RxODE is an R package that facilitates easy simulations in R
20 stars 13 forks source link

Add irregular dosing regimen #13

Open Sibojang9 opened 7 years ago

Sibojang9 commented 7 years ago

For example, I have a dosing regimen like the following:

Time AMT
0    1000
2    2000
10   500

Is there any native function to load this dataframe of dosing events directly? Now I am using a loop to add each dosing event row by row.

for  ( i in 1:nrow(dosing) )  {
   ev$add.dosing(dose = dosing$AMT[i],start.time=dosing$TIME[i]) # add dosing
}
wwang-at-github commented 7 years ago

once you create an event table, there's a member function import.EventTable() with the eventable object to do what you intend to do here.

On Sat, Jun 10, 2017 at 10:33 PM, Sibo Jiang notifications@github.com wrote:

For example, I have a dosing regimen like the following:

Time AMT 0 1000 2 2000 10 500

Is there any native function to load this dataframe of dosing events directly? Now I am using a loop to add each dosing event row by row.

for ( i in 1:nrow(dosing) ) { ev$add.dosing(dose = dosing$AMT[i],start.time=dosing$TIME[i]) # add dosing }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hallowkm/RxODE/issues/13, or mute the thread https://github.com/notifications/unsubscribe-auth/AMdZduMYG506msK7fLyZ0LxBhD3KFwVYks5sC1H0gaJpZM4N2RoU .

Sibojang9 commented 7 years ago

Could you please give an example on how to use it? I cannot find related documentation in either cran manual or the vignettes.

wwang-at-github commented 7 years ago

library(RxODE)

ev <- eventTable() ev$add.dosing(dose=10000, nbr.doses=5, dosing.interval = 24) ev$add.sampling(0:120)

df = ev$get.EventTable() head(df) time evid amt 1 0 101 10000 6 0 0 NA 7 1 0 NA 8 2 0 NA 9 3 0 NA 10 4 0 NA ev <- eventTable() ev EventTable with 0 records: 0 dosing (in NA) records 0 observation time (in hours) records ev$import.EventTable(df) ev EventTable with 126 records: 5 dosing (in NA) records 121 observation time (in hours) records

On Wed, Jun 14, 2017 at 1:34 AM, Sibo Jiang notifications@github.com wrote:

Could you please give an example on how to use it? I cannot find related documentation in either cran manual or the vignettes.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/hallowkm/RxODE/issues/13#issuecomment-308324328, or mute the thread https://github.com/notifications/unsubscribe-auth/AMdZdqEGgL3z8gkW90VkZWn0nKg-Ad9uks5sD3DfgaJpZM4N2RoU .

Sibojang9 commented 7 years ago

Thank you for the clarification. I just want to confirm with you that RxODE uses number 101 to represent a dosing event. Other than that, it seems to be exactly the same as NONMEM for building dosing records.