pharmaverse / admiralmetabolic

Metabolic package extension of admiral
https://pharmaverse.github.io/admiralmetabolic/
Apache License 2.0
5 stars 3 forks source link

Bug: All `OSORRES` in `qs_metabolic` assigned as `2` #54

Closed AndersAskeland closed 3 hours ago

AndersAskeland commented 3 hours ago

What happened?

The qs_metabolic dataset contains the value 2 for all records in OSORRES.

The bug is related to the mutate statement for OSORRES where we assign OSORRES using a non-vectorized method (see below). We would need to change this function to either a vectorized function, or change to rowwise operations in the entire mutate call using dplyr::rowwise().

qs_metabolic_results <- qs_metabolic_shell %>%
  mutate(
    DOMAIN = "QS",
    QSORRES = floor(runif(1) * 10) + round(runif(1)), # the function in question
    QSORRESU = "cm",
    QSSTRESU = "cm",
    QSSTRESN = QSORRES,
    QSSTRESC = as.character(QSORRES),
    QSBLFL = ifelse(VISIT == "BASELINE", "Y", NA_character_)
  )

Session Information

No response

Reproducible Example

No response

AndersAskeland commented 3 hours ago

@pharmaverse/admiralmetabolic A good first issue if there are any takers :)

kathrinflunkert commented 3 hours ago

@AndersAskeland I don't think you have been looking at the latest version. QSORRESU is not "cm" anymore but "mm" and also the bug that all values where 2 had been resolved in the final version.

AndersAskeland commented 3 hours ago

Woops… you’re right. I was on the wrong branch 😅