checkVerbatimLines: Formatting and standardization checks on book chapters

Description Usage Arguments Details Value Author(s) Examples

Description

Formatting and standardization checks on book chapters

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
checkVerbatim(files = .RbcBook1Files(ext=".tex"),
               maxc = 70,
              which = "both",
            verbose = TRUE)

checkRnw(files = .RbcBook1Files(),
       verbose = TRUE, stopOnError=FALSE)

checkPackage(files = .RbcBook1Files(ext=".Rnw"),
           verbose = TRUE)

.RbcBook1Files(ext=".Rnw")

Arguments

files

character vector with names (and path) of chapter source files

ext

character of length 1. File name extension. .Rnw (the default) and .tex should be the most important cases.

maxc

integer of length 1. Maximal number of characters in a verbatim line. All lines exceeding this limit will be reported in the return value of this function.

which

character of length 1. 'Sinput' will look at Sinput environments, 'Soutput' at Soutput environments, 'both' at both.

verbose

Logical.

stopOnError

Logical. If FALSE, first error found will lead to stop. If TRUE, try to continue checking.

Details

checkVerbatimLines sees whether all verbatim lines have length at most maxc.

checkPackage finds all the occurences of \Rpackage{...} in the text, checks whether the package is known, and returns a named list will all occurences of the packages.

Value

For checkVerbatimLines and checkSetup, a data frame with one row for each offending line and various columns describing it.

For .RbcBook1Files, a character vector.

Author(s)

Wolfgang Huber <huber@ebi.ac.uk>

Examples

1
2
3
4
  f = tempfile()
  zap = function(n) paste(formatC(1:n, width=2), collapse=" ")
  writeLines(c("*begin{Sinput}", zap(20), zap(30), "*end{Sinput}"), con=f)
  checkVerbatim(files=f)

RbcBook1 documentation built on Nov. 8, 2020, 7:18 p.m.