I'm trying to check this package before use and was running into a few issues.
I'm receiving errors when trying to run the examples for this package, either independently via tools::testInstalledPackage("MAIC", types = "examples")
or as part of R CMD check
(via devtools::check("./MAIC")
).
Using testInstalledPackage
When using testInstalledPackage
, I get an error about the use of T
. During example execution, T
and F
are masked with code that will throw these errors when they're used (from R email list).
> KM_plot <- ggsurvplot(KM_list,
+ combine = TRUE,
+ risk.table=T, # numbers at risk displayed on the plot
+ break.x.by=50,
+ xlab="Time (days)",
+ censor=FALSE,
+ legend.title = "Treatment",
+ title = "Kaplan-Meier plot of overall survival",
+ legend.labs=c("Intervention",
+ "Intervention weighted",
+ "Comparator"),
+ font.legend = list(size = 10)) +
+ guides(colour=guide_legend(nrow = 2))
Error in ggsurvplot(KM_list, combine = TRUE, risk.table = T, break.x.by = 50, :
T used instead of TRUE
Using R CMD check
A simple enough issue, but currently throwing errors. Fixed by adding Suggests: knitr
to DESCRIPTION
VignetteBuilder package not declared: ‘knitr’
Using devtools::check("./MAIC", vignettes = FALSE)
When running R CMD check I get namespace errors, which may be due to the masking of .oldSearch
in the check environment.
> library(MAIC)
> library(ggplot2)
> library(survminer)
Loading required package: ggpubr
Error: package or namespace load failed for ‘ggpubr’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘foreign’
Error: package ‘ggpubr’ could not be loaded
Execution halted
I think that this might be a result of these undeclared dependencies required to run the examples. Even if these are installed in my library, they aren't being picked up while running the examples during R CMD check
. I was able to fix this by adding these three dependencies as Suggests:
dependencies. With these added, I get the same error as when running tools::testInstalledPackages
(the issue with using T
in examples)
* checking for unstated dependencies in examples ... WARNING
'library' or 'require' calls not declared from:
‘flextable’ ‘officer’ ‘survminer’