README.md

Commonly used R functions for ttecon team

R build status Codecov test coverage

Overview

The ttr package includes commonly used R functions for ttecon team.

Installation

   # install.packages("devtools")
   devtools::install_github('https://github.com/tt-econ/ttr')
   library(ttr)

Maintenance

The production cycle is as follows:

  1. Code is stored in the folder /R. There can be no subfolders.
  2. To load for interactive testing in RStudio, use devtools:

    R # install.packages("devtools") devtools::load_all()

  3. Unit tests are stored in /tests/testthat (file names should start with test) with supplementary files in other subfolders of /tests. The testthat package is bundled with devtools. Comparing test figures is done using vdiffr. In RStudio:

    R # install.packages("vdiffr") devtools::test()

  4. For a thorough check of the package, there are two options:

  5. In RStudio:

     ```R
        devtools::check()
     ```
    

    This will also update all documentations.

  6. On the command line:

     ```bash
        R CMD build [path-to-package]
        R CMD check [resulting-tarball-file]
     ```
    
  7. Code style is enforced using styler.

    R # install.packages("styler") styler::style_pkg()

  8. Documentation is via roxygen2, provided through devtools.

    R devtools::document()

Functionality

Support functions for ggplot



ttecon/ttr documentation built on March 6, 2023, 7:36 a.m.