Bug Report
Description
Selecting all NCA parameters and running NCA causes the app to crash with:
Error in [<-: Can't recycle input of size 996 to size 83.
preceded by:
Warning: Values from `PPSTRES` are not uniquely identified; output will contain list-cols.
Root Cause
When all parameters are selected, PKNCA produces result rows with PPTESTCD = NA and PPSTRES = NA. These are internal dependency calculations that PKNCA runs but doesn't expose as named parameters.
In pivot_wider_pknca_results(), these NA-keyed rows create duplicate keys for pivot_wider() (multiple NA rows per subject/interval), which produces list-columns instead of atomic vectors. Downstream code then crashes trying to assign list-columns into a regular data frame.
Additional finding: missing metadata mappings
Comparing PKNCA::get.interval.cols() with metadata_nca_parameters, 4 PKNCA parameters have no CDISC mapping:
| PKNCA parameter |
Description |
clr.last |
Renal clearance (to Tlast) |
clr.obs |
Renal clearance (observed, using AUCinf.obs) |
clr.pred |
Renal clearance (predicted, using AUCinf.pred) |
count_conc_measured |
Count of measured (non-imputed) concentrations |
These are not the direct cause of the crash (the NA rows are), but they should be added to the metadata for completeness. When selected, translate_terms() returns the raw PKNCA name unchanged, which could cause issues in CDISC exports.
Debugging evidence
# 24 duplicate rows, all with PPTESTCD = NA
dupes %>% select(USUBJID, PPTESTCD, PPSTRES, start, end, DOSNOA) %>% print(n = 10)
# A tibble: 24 x 6
USUBJID PPTESTCD PPSTRES start end DOSNOA
<chr> <chr> <dbl> <dbl> <dbl> <int>
1 S1-01 NA NA 0 24.1 1
2 S1-01 NA NA 0 24.1 1
3 S1-01 NA NA 0 24.1 1
4 S1-01 NA NA 0 24.1 1
...
Steps to Reproduce
- Upload data with multiple study types
- Go to Parameter Selection -> click "Select all"
- Click "Run NCA"
- App crashes
Fix
Filter out NA PPTESTCD rows before pivoting in pivot_wider_pknca_results(). See PR #1232.
Separately, consider adding the 4 missing parameters to metadata_nca_parameters for completeness."
Bug Report
Description
Selecting all NCA parameters and running NCA causes the app to crash with:
preceded by:
Root Cause
When all parameters are selected, PKNCA produces result rows with
PPTESTCD = NAandPPSTRES = NA. These are internal dependency calculations that PKNCA runs but doesn't expose as named parameters.In
pivot_wider_pknca_results(), these NA-keyed rows create duplicate keys forpivot_wider()(multiple NA rows per subject/interval), which produces list-columns instead of atomic vectors. Downstream code then crashes trying to assign list-columns into a regular data frame.Additional finding: missing metadata mappings
Comparing
PKNCA::get.interval.cols()withmetadata_nca_parameters, 4 PKNCA parameters have no CDISC mapping:clr.lastclr.obsclr.predcount_conc_measuredThese are not the direct cause of the crash (the NA rows are), but they should be added to the metadata for completeness. When selected,
translate_terms()returns the raw PKNCA name unchanged, which could cause issues in CDISC exports.Debugging evidence
Steps to Reproduce
Fix
Filter out
NAPPTESTCD rows before pivoting inpivot_wider_pknca_results(). See PR #1232.Separately, consider adding the 4 missing parameters to
metadata_nca_parametersfor completeness."