I tried to make my R shiny app into a package. I created one package called rwdexpull following the package instructions from Hadley Wickham's book.
The app and one function to call the shiny app were created in the structure as suggested in make R shiny as a package. . Shiny app files were put under inst/pullapp while call function file was put in under R folder.
The package passed check. After finishing installation and restart R, however, the function return error say "... is not an exported object from 'namespace:rwdexpull'.
If I run the call function cohortpull in the console, the shiny app works. Any tips on how to solve this issue?
Thanks in advance!
#' Pull data from RWDEx data base
#'
#'
cohortpull <- function(){
appDir <- system.file("pullapp", package = "rwdexpull")
if (appDir == "") {
stop("Could not find pullapp. Try re-installing `rwdexpull`.", call. = FALSE)
}
shiny::runApp(appDir, display.mode = "normal")
}
My session info: R version 4.0.3 (2020-10-10) Platform: x86_64-pc-linux-gnu (64-bit) Running under: CentOS Linux 7 (Core)