#library(mocaredd)
This page shows the different steps to create the package and the main function which is a shiny app, as well as how the app is loaded to shinyapp.io.
Main source for info:
- https://r-pkgs.org/
- https://rtask.thinkr.fr/building-a-shiny-app-as-a-package/
- https://mastering-shiny.org/scaling-packaging.html
Inital setup:
- Create a Github repository.
- Create a R project from Github (See https://happygitwithr.com/ on linking Github repos to Rstudio).
- Create a package structure inside he project:
-
usethis::create_package("PATH/mocaredd")
with PATH the path to the project folder set during the project creation.
-
- Add vignettes and pkgdown setup:
usethis::use_pkgdown()
usethis::use_vignette("app-generation", title = "MCredd - package creation steps")
- Add tests architecture:
usethis::use_testthat()
- Add license:
usethis::use_mit_license()
- Add R CMD check as Github action:
usethis::use_github_action()
- More advanced workflow:
usethis::use_github_action("check-full")
- (optional) Add a fork repo in personnal github
usethis::create_from_github("openforis/mocaredd", fork = TRUE, destdir = "/Users/gaelsola/Github-repos")
Run all the time:
devtools::document()
devtools::load_all()
shiny_run_mocaredd()
devtools::install()
library(mocaredd)
shiny_run_mocaredd()