Skip to content

Commit

Permalink
fix: invalid @export statement for export_cdisc
Browse files Browse the repository at this point in the history
  • Loading branch information
m-kolomanski committed Jan 23, 2025
1 parent f458df0 commit 86a3e06
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 38 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export(as_factor_preserve_label)
export(calculate_summary_stats)
export(check_slope_rule_overlap)
export(create_start_impute)
export(export_cdisc)
export(filter_breaks)
export(filter_slopes)
export(flexible_violinboxplot)
Expand All @@ -28,7 +29,6 @@ export(parse_annotation)
export(parse_tlg_definitions)
export(pivot_wider_pknca_results)
export(pkcg01)
export(pptestcd_dict)
export(run_app)
export(set_empty_label)
import(dplyr)
Expand Down
54 changes: 25 additions & 29 deletions R/export_cdisc.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,6 @@
#'
#' @import dplyr
#' @export


# Define the unique combinations
pptestcd_dict <- setNames(
c(
"Total CL Obs by F", "Time of Last Nonzero Conc", "Max Conc", "Vz Obs by F", "AUC Infinity Obs",
"Last Nonzero Conc", "Time of CMAX", "R Squared", "R Squared Adjusted", "Max Conc Norm by Dose",
"AUC to Last Nonzero Conc Norm by Dose", "Lambda z", "AUC to Last Nonzero Conc",
"Half-Life Lambda z", "Number of points used for Lambda z", "Last Nonzero Conc Predicted",
"Span Ratio", "Lambda z lower limit (time)",

# Manually filled
"Trough Concentration", "Average Concentration", "AUC Infinity Predicted",
"AUMC Infinity Observed", "AUC Percent Extrapolated Observed",
"AUC Percent Extrapolated Predicted", "Clearance Observed",
"Clearance Predicted", "Mean Residence Time Intravenous Observed",
"Volume of Distribution Observed",
"Steady-State Volume of Distribution Intravenous Observed",
"AUC Infinity Observed Dose-Normalized", "Maximum Concentration Dose-Normalized"
),
c("CLFO", "TLST", "CMAX", "VZFO", "AUCIFO", "CLST", "TMAX", "R2", "R2ADJ", "CMAXD", "AUCLSTD",
"LAMZ", "AUCLST", "LAMZHL", "LAMZNPT", "CLSTP", "LAMZSPNR", "LAMZLL",
"CTROUGH", "CAV", "AUCIFP", "AUMCINF.OBS", "AUCPEO", "AUCPEP", "CL.OBS", "CL.PRED",
"MRT.IV.OBS", "VZ.OBS", "VSS.IV.OBS", "AUCINF.OBS.DN", "CMAX.DN"
)
)


export_cdisc <- function(res_nca) {
if (FALSE) {
# uncomment in case of more added variables
Expand Down Expand Up @@ -192,7 +164,7 @@ export_cdisc <- function(res_nca) {
PPENINT = ifelse(end != Inf, end, NA)
) %>%
# Map PPTEST CDISC descriptions using PPTESTCD CDISC names
mutate(PPTEST = pptestcd_dict[PPTESTCD]) %>%
mutate(PPTEST = .pptestcd_dict[PPTESTCD]) %>%
group_by(USUBJID) %>%
mutate(PPSEQ = if ("PCSEQ" %in% names(.)) PCSEQ else row_number()) %>%
ungroup()
Expand All @@ -214,3 +186,27 @@ export_cdisc <- function(res_nca) {

return(list(pp = pp, adpp = adpp))
}

.pptestcd_dict <- setNames(
c(
"Total CL Obs by F", "Time of Last Nonzero Conc", "Max Conc", "Vz Obs by F", "AUC Infinity Obs",
"Last Nonzero Conc", "Time of CMAX", "R Squared", "R Squared Adjusted", "Max Conc Norm by Dose",
"AUC to Last Nonzero Conc Norm by Dose", "Lambda z", "AUC to Last Nonzero Conc",
"Half-Life Lambda z", "Number of points used for Lambda z", "Last Nonzero Conc Predicted",
"Span Ratio", "Lambda z lower limit (time)",

# Manually filled
"Trough Concentration", "Average Concentration", "AUC Infinity Predicted",
"AUMC Infinity Observed", "AUC Percent Extrapolated Observed",
"AUC Percent Extrapolated Predicted", "Clearance Observed",
"Clearance Predicted", "Mean Residence Time Intravenous Observed",
"Volume of Distribution Observed",
"Steady-State Volume of Distribution Intravenous Observed",
"AUC Infinity Observed Dose-Normalized", "Maximum Concentration Dose-Normalized"
),
c("CLFO", "TLST", "CMAX", "VZFO", "AUCIFO", "CLST", "TMAX", "R2", "R2ADJ", "CMAXD", "AUCLSTD",
"LAMZ", "AUCLST", "LAMZHL", "LAMZNPT", "CLSTP", "LAMZSPNR", "LAMZLL",
"CTROUGH", "CAV", "AUCIFP", "AUMCINF.OBS", "AUCPEO", "AUCPEP", "CL.OBS", "CL.PRED",
"MRT.IV.OBS", "VZ.OBS", "VSS.IV.OBS", "AUCINF.OBS.DN", "CMAX.DN"
)
)
11 changes: 3 additions & 8 deletions man/pptestcd_dict.Rd → man/export_cdisc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 86a3e06

Please sign in to comment.