SafetyGraphics / safetyGraphics

Clinical Trial Safety Graphics with R
https://safetygraphics.github.io/safetyGraphics/
Other
93 stars 24 forks source link

safetyGraphicsReport.Rmd export html report error msg #683

Closed xni7 closed 2 years ago

xni7 commented 2 years ago

Hey @jwildfire , @JimBuchanan discovered an error msg after clicking on "html report" button.

Quitting from lines 43-58 (report.Rmd) 

Warning: Error in %in%: object 'domain' not found
  [No stack trace available]

It turns out it's due to namespace conflict between filter() in base R vs. dplyr::filter(). It can be fixed by simply adding the namespace as in this forked branch report-dl: https://github.com/SafetyGraphics/safetyGraphics/compare/dev...xni7:report-dl

Reprex:

devtools::install_github("SafetyGraphics/safetyGraphics@1209f0")

library(purrr)
library(safetyGraphics)
safetyGraphics::safetyGraphicsApp(
  domainData = list(labs = safetyData::adam_adlbc), 
  charts = makeChartConfig() %>% purrr::keep(~.x$label == "Outlier Explorer")
)

rstudioapi::restartSession()

# install a custom version that fix the report issue
devtools::install_github("xni7/safetyGraphics@report-dl")

library(purrr)
library(safetyGraphics)
safetyGraphics::safetyGraphicsApp(
  domainData = list(labs = safetyData::adam_adlbc), 
  charts = makeChartConfig() %>% purrr::keep(~.x$label == "Outlier Explorer")
)

Can do a PR if needed.

jwildfire commented 2 years ago

Thanks @xni7 - I see the same behavior in your reprex. If you can file a quick PR for your branch, I'll approve and merge.