Closed kylebaron closed 2 years ago
Fixed
library(lastdose)
data <- data.frame(
ID = c(1,1,1,2,2,2),
C = c("C", NA, NA, "C", NA, NA),
TIME = c(-1, 0, NA, -1, 0, 0.25),
AMT = c(0, 100, 0, 0, 200, 0),
EVID = c(0, 1, 0, 0, 1, 0)
)
lastdose(data)
#> ID C TIME AMT EVID TAD LDOS
#> 1 1 C -1.00 0 0 -1.00 0
#> 2 1 <NA> 0.00 100 1 0.00 100
#> 3 1 <NA> NA 0 0 NA NA
#> 4 2 C -1.00 0 0 -1.00 0
#> 5 2 <NA> 0.00 200 1 0.00 200
#> 6 2 <NA> 0.25 0 0 0.25 200
Created on 2022-05-05 by the reprex package (v2.0.1)
Not totally sure what's going on
Created on 2022-05-05 by the reprex package (v2.0.1)