# Example I: Single formulation
df1 <- data.frame(
time = c(0, 15, 30, 45, 60, 90, 120, 150, 180),
release = c(0, 11.4, 20.8, 30.8, 39.8, 57.8, 72, 84.8, 93.5)
)
korsmeyer_peppas_model(
data = df1,
time_col = "time",
release_col = "release",
normalize = TRUE # default
)
# Example II: Two formulations (grouped, not pH-dependent)
df2 <- data.frame(
time = rep(c(0, 30, 60, 90, 120, 150), 2),
release = c(
0, 18, 35, 55, 72, 88, # Formulation A
0, 12, 26, 40, 58, 70 # Formulation B
),
formulation = rep(c("Formulation A", "Formulation B"), each = 6)
)
korsmeyer_peppas_model(
data = df2,
time_col = "time",
release_col = "release",
group_col = "formulation"
)
# Example III: pH-dependent release
df_pH <- data.frame(
time = rep(c(0, 60, 120, 180), 2),
release = c(0, 40, 75, 95, 0, 30, 60, 80),
pH = rep(c(7.4, 4.5), each = 4)
)
korsmeyer_peppas_model(
data = df_pH,
time_col = "time",
release_col = "release",
pH_col = "pH"
)
# Example IV: Two formulations under two pH conditions
df1 <- data.frame(
time = rep(c(0, 20, 40, 60, 80, 100, 120, 140, 160, 180), 2),
release = c(
0, 12, 25, 38, 50, 62, 73, 82, 89, 95, # pH 4.5
0, 15, 30, 45, 59, 70, 79, 86, 91, 97 # pH 7.6
),
pH = rep(c(4.5, 7.6), each = 10)
)
df2 <- data.frame(
time = rep(c(0, 15, 30, 45, 60, 75, 90, 105, 120, 135), 2),
release = c(
0, 10, 22, 34, 46, 57, 67, 76, 84, 91, # pH 4.5
0, 13, 27, 41, 55, 67, 77, 85, 92, 98 # pH 7.6
),
pH = rep(c(4.5, 7.6), each = 10)
)
df_all <- rbind(
cbind(formulation = "Dataset 1", df1),
cbind(formulation = "Dataset 2", df2)
)
korsmeyer_peppas_model(
data = df_all,
time_col = "time",
release_col = "release",
group_col = "formulation",
pH_col = "pH"
)
Run the code above in your browser using DataLab