# Example I: Single Formulation
df <- data.frame(
sqrt_time = c(0, 3.873, 5.477, 6.708, 7.746, 9.487, 10.954, 12.247, 13.416),
release = c(0, 11.4, 20.8, 30.8, 39.8, 57.8, 72, 84.8, 93.5)
)
higuchi_release(
data = df,
sqrt_time_col = "sqrt_time",
release_col = "release"
)
# Example II: Two formulations (grouped, not pH-dependent)
df_2 <- data.frame(
sqrt_time = c(0, 3.873, 5.477, 6.708, 7.746, 9.487, 10.954, 12.247, 13.416),
release = c(
0, 11.4, 20.8, 30.8, 39.8, 57.8, 72.0, 84.8, 93.5, # Formulation A
0, 10.2, 18.6, 29.7, 37.8, 56.5, 71.9, 83.7, 92.9 # Formulation B
),
formulation = rep(c("Formulation A", "Formulation B"), each = 9)
)
higuchi_release(
data = df_2,
sqrt_time_col = "sqrt_time",
release_col = "release",
group_col = "formulation"
)
# Example III: pH-dependent Higuchi release
df_pH <- data.frame(
sqrt_time = rep(
c(0, 3.873, 5.477, 6.708, 7.746, 9.487, 10.954, 12.247, 13.416),
2
),
release = c(
0, 11.4, 20.8, 30.8, 39.8, 57.8, 72.0, 84.8, 93.5, # pH 7.4
0, 17.2, 23.8, 35.5, 41.5, 58.3, 73.6, 86.2, 93.1 # pH 4.5
),
pH = rep(c(7.4, 4.5), each = 9)
)
higuchi_release(
data = df_pH,
sqrt_time_col = "sqrt_time",
release_col = "release",
pH_col = "pH"
)
# Example IV: Two formulations under two pH conditions
df1 <- data.frame(
sqrt_time = rep(c(0.0, 2.5, 4.0, 5.2, 6.3, 7.4, 8.6, 9.8, 11.0, 12.2), 2),
release = c(
0.0, 12.5, 21.8, 31.2, 39.6, 50.8, 63.5, 74.2, 84.9, 92.8, # pH 7.4
0.0, 9.8, 18.6, 26.9, 34.7, 45.3, 56.8, 67.9, 77.4, 85.2 # pH 4.5
),
pH = rep(c(7.4, 4.5), each = 10)
)
df2 <- data.frame(
sqrt_time = rep(c(0.0, 2.5, 4.0, 5.2, 6.3, 7.4, 8.6, 9.8, 11.0, 12.2), 2),
release = c(
0.0, 11.3, 20.4, 29.1, 37.8, 48.6, 60.1, 71.0, 81.5, 89.6, # pH 7.4
0.0, 8.9, 16.7, 24.6, 32.1, 42.5, 53.4, 64.0, 73.1, 80.8 # pH 4.5
),
pH = rep(c(7.4, 4.5), each = 10)
)
df_all <- rbind(
cbind(formulation = "Dataset 1", df1),
cbind(formulation = "Dataset 2", df2)
)
higuchi_release(
data = df_all,
sqrt_time_col = "sqrt_time",
release_col = "release",
group_col = "formulation",
pH_col = "pH"
)
Run the code above in your browser using DataLab