Closed KatherineKayMRG closed 2 years ago
How about this?
library(pmtables)
bq_col <- "BQL"
pt_data_inventory_notes(bq_col)
#> [1] "SUBJ: subjects"
#> [2] "BQL: below quantitation limit"
#> [3] "MISS: missing observations (not BQL)"
#> [4] "OBS: observations"
bq_col <- "BLQ"
pt_data_inventory_notes(bq_col)
#> [1] "SUBJ: subjects"
#> [2] "BLQ: below limit of quantitation"
#> [3] "MISS: missing observations (not BQL)"
#> [4] "OBS: observations"
Created on 2022-01-13 by the reprex package (v2.0.1)
Hang on; need to fix MISS
then.
library(pmtables)
bq_col <- "BQL"
pt_data_inventory_notes(bq_col)
#> [1] "SUBJ: subjects" "BQL: below quantitation limit"
#> [3] "MISS: missing observations (BQL)" "OBS: observations"
bq_col <- "BLQ"
pt_data_inventory_notes(bq_col)
#> [1] "SUBJ: subjects" "BLQ: below limit of quantitation"
#> [3] "MISS: missing observations (BLQ)" "OBS: observations"
Created on 2022-01-13 by the reprex package (v2.0.1)
And then handling if we just don't want BLQ
library(pmtables)
bq_col <- "BQL"
pt_data_inventory_notes(bq_col)
#> [1] "SUBJ: subjects" "BQL: below quantitation limit"
#> [3] "MISS: missing observations (BQL)" "OBS: observations"
bq_col <- "BLQ"
pt_data_inventory_notes(bq_col)
#> [1] "SUBJ: subjects" "BLQ: below limit of quantitation"
#> [3] "MISS: missing observations (BLQ)" "OBS: observations"
pt_data_inventory_notes(bq_col, drop_bql = TRUE)
#> [1] "SUBJ: subjects" "MISS: missing observations"
#> [3] "OBS: observations"
Created on 2022-01-13 by the reprex package (v2.0.1)
That looks good - does BLQ appear in the column headings too for bq_col <- "BLQ"
Also, did we ever come to a decision regarding "quantitation" vs "quantification"?
We can change that too; will check on columns and make sure it's right.
Closer ...
That looks good to me :)
Cool; I'll get this cleaned up and documented etc. Thanks for the report. Also ... can you move the text starting with For example
out of the main post and into a comment? I'd like to keep this issue open and that can't be there in the validation docs.
Thanks for getting to this so quickly!
I don't want to have to use gsub in this example
pkSum %>%
pt_data_inventory(by = c("Race" = "RACEA_f"),
panel = "DVID_f",
stacked = T,
bq_col = "BLQ") %>%
as_stable(output_file = "pk-data-sum.tex") %>%
gsub("BQL", "BLQ", .) %>%
gsub("below quantitation limit", "below limit of quantitation", .)
Sorry, I just realised what you meant but now it won't let me change my original comment
oh nm, looks like you managed it
Summary
As a user, I want pt_data_inventory to change my colname/footer description for BLQ if I use
bq_col = "BLQ"
Tests