Package 'srr'

Title: 'rOpenSci' Review Roclets
Description: Companion package to 'rOpenSci' statistical software review project.
Authors: Mark Padgham [aut, cre]
Maintainer: Mark Padgham <[email protected]>
License: MIT + file LICENSE
Version: 0.1.3.011
Built: 2024-08-27 09:17:04 UTC
Source: https://github.com/ropensci-review-tools/srr

Help Index


Generate report from ssr tags.

Description

Generate report from ssr tags.

Usage

srr_report(path = ".", branch = "", view = TRUE, roxygenise = TRUE)

Arguments

path

Path to package for which report is to be generated

branch

By default a report will be generated from the current branch as set on the local git repository; this parameter can be used to specify any alternative branch.

view

If TRUE (default), a html-formatted version of the report is opened in default system browser. If FALSE, the return object includes the name of a html-rendered version of the report in an attribute named 'file'.

roxygenise

If TRUE (default), documentation will first be updated with the roxygen2 package. This requires local installation of the package, which may take some time if the package has not previously been installed. If this parameter is FALSE, the roxygen2 package is not used, documentation is not updated, and reports are generally generated faster.

Value

(invisibly) Markdown-formatted lines used to generate the final html document.

Examples

## Not run: 
path <- srr_stats_pkg_skeleton ()
srr_report (path)

## End(Not run)

Get details of current statistical software categories

Description

List all currently available categories and associated URLs to full category descriptions.

Usage

srr_stats_categories()

Value

A data.frame with 3 columns of "category" (the categories to be submitted to srr_stats_checklist), "title" (the full title), and "url".

See Also

Other helper: srr_stats_checklist(), srr_stats_checklist_check(), srr_stats_pkg_skeleton(), srr_stats_pre_submit()

Examples

srr_stats_categories ()

Download checklists of statistical software standards

Description

Obtain rOpenSci standards for statistical software, along with one or more category-specific standards, as a checklist, and store the result in the local clipboard ready to paste.

Usage

srr_stats_checklist(category = NULL, filename = NULL)

Arguments

category

One of the names of files given in the directory contents of https://github.com/ropensci/statistical-software-review-book/tree/main/standards, each of which is ultimately formatted into a sub-section of the standards.

filename

Optional name of local file to save markdown-formatted checklist. A suffix of .md will be automatically appended.

Value

A character vector containing a markdown-style checklist of general standards along with standards for any additional categories.

See Also

Other helper: srr_stats_categories(), srr_stats_checklist_check(), srr_stats_pkg_skeleton(), srr_stats_pre_submit()

Examples

## Not run: 
x <- srr_stats_checklist (category = "regression")
# or write to specified file:
f <- tempfile (fileext = ".md")
x <- srr_stats_checklist (category = "regression", filename = f)

## End(Not run)

Check a completed standards checklist

Description

Correct any potential formatting issues in a completed standards checklist

Usage

srr_stats_checklist_check(file)

Arguments

file

Name of local file containing a completed checklist. Must be a markdown document in .md format, not .Rmd or anything else.

See Also

Other helper: srr_stats_categories(), srr_stats_checklist(), srr_stats_pkg_skeleton(), srr_stats_pre_submit()

Examples

## Not run: 
f <- tempfile (fileext = ".md")
srr_stats_checklist (category = "regression", filename = f)
chk <- srr_stats_checklist_check (f)

## End(Not run)

Make skeleton package to test roclet system

Description

Make a dummy package skeleton including 'srr' roxygen2 tags which can be used to try out the functionality of this package. Running the example lines below which activate the 'srr' roclets, and show you what the output of those roclets looks like. Feel free to examine the effect of modifying any of the ⁠@srrstats⁠ tags within the code as identified by running those lines.

Usage

srr_stats_pkg_skeleton(base_dir = tempdir(), pkg_name = "demo")

Arguments

base_dir

The base directory where the package should be constructed.

pkg_name

The name of the package. The final location of this package will be in file.path(base_dir, pkg_name).

Value

The path to the directory holding the newly created package

See Also

Other helper: srr_stats_categories(), srr_stats_checklist(), srr_stats_checklist_check(), srr_stats_pre_submit()

Examples

d <- srr_stats_pkg_skeleton (pkg_name = "mystatspkg")
# (capture.output of initial compliation messages)
x <- utils::capture.output (roxygen2::roxygenise (d), type = "output")

Perform pre-submission checks

Description

Check that all standards are present in code, and listed either as '@srrstats' or '@srrstatsNA'

Usage

srr_stats_pre_submit(path = ".", quiet = FALSE)

Arguments

path

Path to local repository to check

quiet

If 'FALSE', display information on status of package on screen.

Value

(Invisibly) List of any standards missing from code

See Also

Other helper: srr_stats_categories(), srr_stats_checklist(), srr_stats_checklist_check(), srr_stats_pkg_skeleton()

Examples

d <- srr_stats_pkg_skeleton ()
# The skeleton has 'TODO' standards, and also has only a few from the full
# list expected for the categories specified there.
srr_stats_pre_submit (d)

srr_stats_roclet

Description

Get values of all srrstats tags in function documentation

Usage

srr_stats_roclet()

Details

Note that this function should never need to be called directly. It only exists to enable "@srrstats" tags to be parsed from roxygen2 documentation.

Value

A roxygen2 roclet

See Also

Other roxygen: srr_stats_roxygen()

Examples

srr_stats_roclet ()

Insert standards into code in roxygen2 format

Description

Obtain rOpenSci standards for statistical software, along with one or more category-specific standards, as a checklist, convert to project-specific roxygen2 format, and save in nominated file.

Usage

srr_stats_roxygen(
  category = NULL,
  filename = "srr-stats-standards.R",
  overwrite = FALSE
)

Arguments

category

One of the names of files given in the directory contents of https://github.com/ropensci/statistical-software-review-book/tree/main/standards, each of which is ultimately formatted into a sub-section of the standards.

filename

Name of 'R' source file in which to write roxygen2-formatted lists of standards.

overwrite

If FALSE (default) and filename already exists, a dialog will ask whether file should be overwritten.

Value

Nothing

See Also

Other roxygen: srr_stats_roclet()

Examples

## Not run: 
path <- srr_stats_pkg_skeleton ()
# contains a few standards; insert all with:
f <- file.path (path, "R", "srr-stats-standards.R")
file.exists (f)
length (readLines (f)) # only 14 lines
srr_stats_roxygen (
    category = "regression",
    file = f,
    overwrite = TRUE
)
length (readLines (f)) # now much longer

## End(Not run)