# pacman::p_load(tidyverse, psych, haven, knitr, caret, conflicted)
knitr::opts_chunk$set(
  message = FALSE,
  warning = FALSE,
  class.source = "foldable",
    include = FALSE
)
knitr::opts_chunk$set(class.source = "foldable")
# conflict_prefer("filter", "dplyr")

1. Long Term Goals

2. Build & Check

Everything concerning Rstudio Build and Check

2.1 Handling of Build Errors, Warnings and Notes

2.1.1 Notes

  1. Note: Timestamps
    See also stackoverflow

    Unable to verify checking for future file timestamps ... NOTE

    • Solution
      Sys.setenv('_R_CHECK_SYSTEM_CLOCK_' = 0)

2.1.2 Warnings

To be written

2.1.3 Errors

to be written

2.2 Ignoring Addtional Files for Package Building

Adding files or dirs to the .Rbuildignore
This is e.g., necessary for pkgdown files

usethis::use_build_ignore("filetobe.ignored") 

See also, this blog

2.3 Ignoring Vignettes

Because rendering vignettes can be extremely ressource (time) intensive it sometimes is helpful, to prohibit their rendering during build.

Steps

  1. Go to Rstudio
  2. Project Options
  3. Build Tools
    • Add --no-build-vignettes to build options
    • Add --ignore-vignettes to check options

For reference see stackoverflow

3. Roxygen Docstrings

3.1 Formatting of docstrings

A good reference list can be found here: r-pkgs.org

3.2 Previewing Changes

Instead of Building the complete package you can preview docstrings by following these steps.

Steps

  1. Render them with ctrl + shift + d
  2. Update the loaded package with devtools::load_all()
  3. Inspect the desired function with ?function_name
    • e.g. for datscience ?get_number_of_decimals

4. pkgdown Creation

4.1 Update the Index / Main Page

The advantage of just updating the index / main is that is way faster than building everything up again. Follow these steps in order to update only the main page of the github pages

  1. Change the README.rmd according to your wishes
  2. Knit this markdown file (ctrl + umsch + k)
  3. Run pkgdown::build_home()
  4. Run usethis::use_pkgdown_github_pages()


Buedenbender/datscience documentation built on Nov. 21, 2022, 11:14 a.m.