This vignette contains handy commands for the package development workflow.

Test data

ODK Central setup QR code for example data To generate test data and run package tests, the XLSForm versions of the package forms are deployed to the ruODK test server.

Only package maintainers should use this QR code to add more test data. No guarantees are given about the longevity of data submitted to the test server. Submitted data should be considered potentially publicly visible and ephemeral.

Packaged data is refreshed from the test data by running

Sys.setenv(RUODK_UN = "...")
Sys.setenv(RUODK_PW = "...")
source("data_raw/make_data.R")

with credentials RUODK_UN and RUODK_PW for a web user with access to the test project.

Develop

  • Create issue
  • Add new code, docs, tests. Update or expand vignettes and README where applicable.
  • Once tests pass, commit referencing the issue.
  • If the change is user-facing, add a line in NEWS.md referencing the issue.
  • Increase version number.

Release

styler::style_pkg()
devtools::document(roclets = c("rd", "collate", "namespace"))
spelling::spell_check_package(here::here())
spelling::spell_check_files(here::here("README.Rmd"), lang = "en_AU")
spelling::update_wordlist(here::here())
codemetar::write_codemeta("rOzCBI")
rmarkdown::render(here::here("README.Rmd"), encoding = "UTF-8", clean = TRUE)
if (fs::file_exists(here::here("README.html"))) fs::file_delete(here::here("README.html"))
codemetar::give_opinions("/home/florian/projects/rOzCBI/.")
goodpractice::goodpractice(path = here::here(), quiet = FALSE)

Hex sticker

How good was that burn?

# remotes::install_github("GuangchuangYu/hexSticker")
library(hexSticker)
library(showtext)
library(sysfonts)
sysfonts::font_families()
sysfonts::font_add_google("Fredoka One", "fire")
sysfonts::font_add_google("Fredericka the Great", "fredericka")
# sysfonts::font_add_google("Big Shoulders Display", "shoulders")
# logo s_, text p_, bg h_, url u_
hexSticker::sticker(
  here::here("man", "figures", "fire.jpg"),
  asp = 1,
  s_x = 1.0, s_y = 1.05, s_width = 1.5, # s_height = 0.1,
  package = "rOzCBI", p_x = 1, p_y = 0.7, p_size = 32,
  p_family = "fredericka", p_color = "#ffffff",
  url = "dbca-wa.github.io/rOzCBI", u_size = 4, u_color = "#ffffff",
  h_fill = "#aaaaaa", h_color = "#000000",
  white_around_sticker = T,
  filename = here::here("man", "figures", "rOzCBI.png")
)