This function provides code to install all packages needed for the complete sitrep ecosystem, ensuring you have everything needed for working without internet connection.

sitrep_install_deps(
  upgrade = "ask",
  dependencies = TRUE,
  repos = getOption("repos"),
  quiet = FALSE,
  force = FALSE
)

Arguments

upgrade

Should packages be upgraded? Options: "ask", "always", "never". Default is "ask"

dependencies

Should dependencies be installed? Default is TRUE

repos

Repository to use. Default uses getOption("repos")

quiet

Should installation be quiet? Default is FALSE

force

Should installation proceed without prompts? Default is FALSE

Value

Character vector of all dependency package names (invisibly).

Details

This function reads the sitrep DESCRIPTION file and provides code to install all packages listed in Depends, Imports, and Suggests fields. This ensures complete functionality in offline environments.

Examples

# \donttest{
# Install everything for offline field work (with prompts)
sitrep_install_deps()
#> sitrep ecosystem package status:
#> ================================
#> Already installed: 46 packages
#> 
#> Checking for updates to 46 existing packages...
#> Running the below code may take several minutes...
#> 
#> 
#> Start a clean R session then run:
#> 
#> install.packages(
#>   c('apyramid', 'epidict', 'epikit', 'epitabulate', 'utils', 'anthro', 'binom', 'broom', 'clipr', 'covr', 'dplyr', 'flextable', 'forcats', 'ggalluvial', 'ggplot2', 'ggspatial', 'glue', 'gtsummary', 'here', 'janitor', 'knitr', 'labelled', 'lubridate', 'matchmaker', 'pacman', 'parsedate', 'patchwork', 'purrr', 'rio', 'rlang', 'rmarkdown', 'scales', 'sessioninfo', 'sf', 'slider', 'srvyr', 'stats', 'stringr', 'summarytools', 'survey', 'testthat', 'tibble', 'tidyr', 'tidyselect', 'tsibble', 'vdiffr'),
#>   dependencies = TRUE,
#>   repos = 'https://packagemanager.posit.co/cran/__linux__/noble/latest''https://cran.rstudio.com',
#>   upgrade = 'ask',
#>   quiet = FALSE
#> )
#> 
#> After running the install code, sitrep ecosystem is ready for offline use.
#> Run sitrep_check_deps() to verify all packages are working.

# Install without prompts
sitrep_install_deps(force = TRUE)
#> sitrep ecosystem package status:
#> ================================
#> Already installed: 46 packages
#> 
#> Checking for updates to 46 existing packages...
#> Running the below code may take several minutes...
#> 
#> 
#> Start a clean R session then run:
#> 
#> install.packages(
#>   c('apyramid', 'epidict', 'epikit', 'epitabulate', 'utils', 'anthro', 'binom', 'broom', 'clipr', 'covr', 'dplyr', 'flextable', 'forcats', 'ggalluvial', 'ggplot2', 'ggspatial', 'glue', 'gtsummary', 'here', 'janitor', 'knitr', 'labelled', 'lubridate', 'matchmaker', 'pacman', 'parsedate', 'patchwork', 'purrr', 'rio', 'rlang', 'rmarkdown', 'scales', 'sessioninfo', 'sf', 'slider', 'srvyr', 'stats', 'stringr', 'summarytools', 'survey', 'testthat', 'tibble', 'tidyr', 'tidyselect', 'tsibble', 'vdiffr'),
#>   dependencies = TRUE,
#>   repos = 'https://packagemanager.posit.co/cran/__linux__/noble/latest''https://cran.rstudio.com',
#>   upgrade = 'ask',
#>   quiet = FALSE
#> )
#> 
#> After running the install code, sitrep ecosystem is ready for offline use.
#> Run sitrep_check_deps() to verify all packages are working.

# Install quietly without prompts or upgrades
sitrep_install_deps(upgrade = "never", quiet = TRUE, force = TRUE)
# }