NOTES

Define data

pkg_config

pkg_config <-
  tibble::tibble(key = character(),
                 default_value = list(),
                 default_value_dynamic = character(),
                 require = logical(),
                 description = character()) |>
  tibble::add_row(key = "locale",
                  default_value = list("en-US"),
                  description = paste0("Locale identifier consisting of a [ISO 639-1](https://en.wikipedia.org/wiki/ISO_639-1) or [ISO ",
                                       "639-3](https://en.wikipedia.org/wiki/ISO_639-3) language code plus an optional country identifier separated by a ",
                                       "hyphen (`-`). For example `\"fr\"` or `\"de-CH\"`."),
                  require = FALSE) |>
  tibble::add_row(key = "font_family_body",
                  default_value = list("Alegreya Sans"),
                  description = "Body font family for [plot theming functions](https://salim.rpkg.dev/reference/#plot-theming).",
                  require = TRUE) |>
  tibble::add_row(key = "plot_color_body",
                  default_value = list("#343a40"),
                  description = "Body color for [plot theming functions](https://salim.rpkg.dev/reference/#plot-theming).",
                  require = TRUE) |>
  tibble::add_row(key = "plot_color_bg",
                  default_value = list("#f2f2f2"),
                  description = "Background color for [plot theming functions](https://salim.rpkg.dev/reference/#plot-theming).",
                  require = TRUE) |>
  tibble::add_row(key = "plot_color_grid",
                  default_value = list("#d9d9d9"),
                  description = "Grid color for [plot theming functions](https://salim.rpkg.dev/reference/#plot-theming).",
                  require = TRUE)

pkg_mgr_software

Define what R-related software is available via Homebrew, Chocolatey and Scoop.

pkg_mgr_software <- list(
  "Git" = list(brew = list(url = "https://formulae.brew.sh/formula/git",
                           cmd = "brew install git"),
               scoop = list(url = "https://scoop.sh/#/apps?q=git",
                            cmd = "scoop install git"),
               choco = list(url = "https://community.chocolatey.org/packages/git",
                            cmd = "choco install git")),
  "Quarto" = list(brew = list(url = "https://formulae.brew.sh/cask/quarto",
                              cmd = "brew install --cask quarto")),
  "R" = list(brew = list(url = "https://formulae.brew.sh/formula/r",
                         cmd = "brew install r"),
             scoop = list(url = "https://scoop.sh/#/apps?q=R+statistical+computing",
                          cmd = "scoop install r"),
             choco = list(url = "https://community.chocolatey.org/packages/R",
                          cmd = "choco install r")),
  "RStudio" = list(brew = list(url = "https://formulae.brew.sh/cask/rstudio",
                               cmd = "brew install --cask rstudio"),
                   scoop = list(url = "https://scoop.sh/#/apps?q=rstudio",
                                cmd = "scoop bucket add extras; scoop install rstudio"),
                   choco = list(url = "https://community.chocolatey.org/packages/R.Studio",
                                cmd = "choco install r.studio"))
)

Write data

Save all the small data objects as a single internal file R/sysdata.rda. Note that when documenting them, they must be explicitly @exported to be available to package users.

usethis::use_data(pkg_config,
                  pkg_mgr_software,
                  internal = TRUE,
                  overwrite = TRUE,
                  compress = "xz",
                  version = 3L)


salim-b/salim documentation built on Oct. 10, 2024, 2:19 a.m.