Skip to content

Commit

Permalink
Convert documentation to use roxygen markdown
Browse files Browse the repository at this point in the history
  • Loading branch information
jimhester committed Sep 18, 2018
1 parent 3ca4519 commit 5d866d4
Show file tree
Hide file tree
Showing 71 changed files with 315 additions and 314 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ Remotes:
r-lib/covr,
r-lib/rcmdcheck
RoxygenNote: 6.1.0
Roxygen: list(markdown = TRUE)
4 changes: 2 additions & 2 deletions R/R.r
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#' Devtools sets a number of environmental variables to ensure consistent
#' between the current R session and the new session, and to ensure that
#' everything behaves the same across systems. It also suppresses a common
#' warning on windows, and sets \code{NOT_CRAN} so you can tell that your
#' code is not running on CRAN. If \code{NOT_CRAN} has been set externally, it
#' warning on windows, and sets `NOT_CRAN` so you can tell that your
#' code is not running on CRAN. If `NOT_CRAN` has been set externally, it
#' is not overwritten.
#'
#' @keywords internal
Expand Down
2 changes: 1 addition & 1 deletion R/bash.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Open bash shell in package directory.
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' [as.package()] for more information
#' @export
bash <- function(pkg = ".") {
pkg <- as.package(pkg)
Expand Down
6 changes: 3 additions & 3 deletions R/build-manual.R
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#' Create package pdf manual
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information.
#' [as.package()] for more information.
#' @param path path in which to produce package manual.
#' If \code{NULL}, defaults to the parent directory of the package.
#' If `NULL`, defaults to the parent directory of the package.
#'
#' @seealso \code{\link{Rd2pdf}}
#' @seealso [Rd2pdf()]
#' @export
build_manual <- function(pkg = ".", path = NULL) {
pkg <- as.package(pkg)
Expand Down
4 changes: 2 additions & 2 deletions R/check-devtools.r
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' Custom devtools release checks.
#'
#' This function performs additional checks prior to release. It is called
#' automatically by \code{\link{release}()}.
#' automatically by [release()].
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information.
#' [as.package()] for more information.
#' @keywords internal
#' @export
release_checks <- function(pkg = ".", built_path = NULL) {
Expand Down
6 changes: 3 additions & 3 deletions R/check-doc.r
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
#' Check documentation, as \code{R CMD check} does.
#' Check documentation, as `R CMD check` does.
#'
#' This function attempts to run the documentation related checks in the
#' same way that \code{R CMD check} does. Unfortunately it can't run them
#' same way that `R CMD check` does. Unfortunately it can't run them
#' all because some tests require the package to be loaded, and the way
#' they attempt to load the code conflicts with how devtools does it.
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' [as.package()] for more information
#' @return Nothing. This function is called purely for it's side effects: if
# no errors there will be no output.
#' @export
Expand Down
4 changes: 2 additions & 2 deletions R/check-git.r
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#' Git checks.
#'
#' This function performs Git checks checks prior to release. It is called
#' automatically by \code{\link{release}()}.
#' automatically by [release()].
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information.
#' [as.package()] for more information.
#' @keywords internal
git_checks <- function(pkg = ".") {
pkg <- as.package(pkg)
Expand Down
10 changes: 5 additions & 5 deletions R/check-results.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ trunc_middle <- function(x, n_max = 25, n_top = 10, n_bottom = 10) {

#' Parses R CMD check log file for ERRORs, WARNINGs and NOTEs
#'
#' Extracts check messages from the \code{00check.log} file generated by
#' \code{R CMD check}.
#' Extracts check messages from the `00check.log` file generated by
#' `R CMD check`.
#'
#' @param path check path, e.g., value of the \code{check_dir} argument in a
#' call to \code{\link{check}}
#' @param path check path, e.g., value of the `check_dir` argument in a
#' call to [check()]
#' @param error,warning,note logical, indicates if errors, warnings and/or
#' notes should be returned
#' @return a character vector with the relevant messages, can have length zero
#' if no messages are found
#'
#' @seealso \code{\link{check}}, \code{\link{revdep_check}}
#' @seealso [check()], [revdep_check()]
#' @export
check_failures <- function(path, error = TRUE, warning = TRUE, note = TRUE) {
check_dir <- file.path(path, "00check.log")
Expand Down
10 changes: 5 additions & 5 deletions R/check-win.r
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#' Build windows binary package.
#'
#' This function works by bundling source package, and then uploading to
#' \url{http://win-builder.r-project.org/}. Once building is complete you'll
#' <http://win-builder.r-project.org/>. Once building is complete you'll
#' receive a link to the built package in the email address listed in the
#' maintainer field. It usually takes around 30 minutes. As a side effect,
#' win-build also runs \code{R CMD check} on the package, so \code{build_win}
#' win-build also runs `R CMD check` on the package, so `build_win`
#' is also useful to check that your package is ok on windows.
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' [as.package()] for more information
#' @inheritParams pkgbuild::build
#' @param quiet If \code{TRUE}, suppresses output.
#' @param ... Additional arguments passed to \code{\link[pkgbuild]{build}}.
#' @param quiet If `TRUE`, suppresses output.
#' @param ... Additional arguments passed to [pkgbuild::build()].
#' @family build functions
#' @name check_win
NULL
Expand Down
62 changes: 31 additions & 31 deletions R/check.r
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#' Build and check a package, cleaning up automatically on success.
#'
#' \code{check} automatically builds and checks a source package, using all
#' known best practices. \code{check_built} checks an already built package.
#' `check` automatically builds and checks a source package, using all
#' known best practices. `check_built` checks an already built package.
#'
#' Passing \code{R CMD check} is essential if you want to submit your package
#' Passing `R CMD check` is essential if you want to submit your package
#' to CRAN: you must not have any ERRORs or WARNINGs, and you want to ensure
#' that there are as few NOTEs as possible. If you are not submitting to CRAN,
#' at least ensure that there are no ERRORs or WARNINGs: these typically
#' represent serious problems.
#'
#' \code{check} automatically builds a package before calling \code{check_built}
#' `check` automatically builds a package before calling `check_built`
#' as this is the recommended way to check packages. Note that this process
#' runs in an independent realisation of R, so nothing in your current
#' workspace will affect the process.
Expand All @@ -22,34 +22,34 @@
#' \itemize{
#'
#' \item The standard environment variables set by devtools:
#' \code{\link{r_env_vars}}. Of particular note for package tests is the
#' \code{NOT_CRAN} env var which lets you know that your tests are not
#' [r_env_vars()]. Of particular note for package tests is the
#' `NOT_CRAN` env var which lets you know that your tests are not
#' running on cran, and hence can take a reasonable amount of time.
#'
#' \item Debugging flags for the compiler, set by
#' \code{\link{compiler_flags}(FALSE)}.
#'
#' \item If \code{aspell} is found \code{_R_CHECK_CRAN_INCOMING_USE_ASPELL_}
#' is set to \code{TRUE}. If no spell checker is installed, a warning is
#' \item If `aspell` is found `_R_CHECK_CRAN_INCOMING_USE_ASPELL_`
#' is set to `TRUE`. If no spell checker is installed, a warning is
#' issued.)
#'
#' \item env vars set by arguments \code{incoming}, \code{remote} and
#' \code{force_suggests}
#' \item env vars set by arguments `incoming`, `remote` and
#' `force_suggests`
#' }
#'
#' @return An object containing errors, warnings, and notes.
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' @param document If \code{NA} and the package uses roxygen2, will
#' rerun \code{\link{document}} prior to checking. Use \code{TRUE}
#' and \code{FALSE} to override this default.
#' @param build_args Additional arguments passed to \code{R CMD build}
#' [as.package()] for more information
#' @param document If `NA` and the package uses roxygen2, will
#' rerun [document()] prior to checking. Use `TRUE`
#' and `FALSE` to override this default.
#' @param build_args Additional arguments passed to `R CMD build`
#' @param check_dir the directory in which the package is checked
#' compatibility. \code{args = "--output=/foo/bar"} can be used to change the
#' compatibility. `args = "--output=/foo/bar"` can be used to change the
#' check directory.
#' @param ... Additional arguments passed on to \code{\link[pkgbuild]{build}()}.
#' @param ... Additional arguments passed on to [pkgbuild::build()].
#' @param cleanup Deprecated.
#' @seealso \code{\link{release}} if you want to send the checked package to
#' @seealso [release()] if you want to send the checked package to
#' CRAN.
#' @export
check <- function(pkg = ".",
Expand Down Expand Up @@ -131,24 +131,24 @@ check <- function(pkg = ".",
#' @export
#' @rdname check
#' @param path Path to built package.
#' @param cran if \code{TRUE} (the default), check using the same settings as
#' @param cran if `TRUE` (the default), check using the same settings as
#' CRAN uses.
#' @param remote Sets \code{_R_CHECK_CRAN_INCOMING_REMOTE_} env var.
#' If \code{TRUE}, performs a number of CRAN incoming checks that require
#' @param remote Sets `_R_CHECK_CRAN_INCOMING_REMOTE_` env var.
#' If `TRUE`, performs a number of CRAN incoming checks that require
#' remote access.
#' @param incoming Sets \code{_R_CHECK_CRAN_INCOMING_} env var.
#' If \code{TRUE}, performs a number of CRAN incoming checks.
#' @param force_suggests Sets \code{_R_CHECK_FORCE_SUGGESTS_}. If
#' \code{FALSE} (the default), check will proceed even if all suggested
#' @param incoming Sets `_R_CHECK_CRAN_INCOMING_` env var.
#' If `TRUE`, performs a number of CRAN incoming checks.
#' @param force_suggests Sets `_R_CHECK_FORCE_SUGGESTS_`. If
#' `FALSE` (the default), check will proceed even if all suggested
#' packages aren't found.
#' @param run_dont_test Sets \code{--run-donttest} so that tests surrounded in
#' @param run_dont_test Sets `--run-donttest` so that tests surrounded in
#' \code{\\dontest\{\}} are also tested. This is important for CRAN
#' submission.
#' @param manual If \code{FALSE}, don't build and check manual
#' (\code{--no-manual}).
#' @param args Additional arguments passed to \code{R CMD check}
#' @param env_vars Environment variables set during \code{R CMD check}
#' @param quiet if \code{TRUE} suppresses output from this function.
#' @param manual If `FALSE`, don't build and check manual
#' (`--no-manual`).
#' @param args Additional arguments passed to `R CMD check`
#' @param env_vars Environment variables set during `R CMD check`
#' @param quiet if `TRUE` suppresses output from this function.
#' @inheritParams rcmdcheck::rcmdcheck
check_built <- function(path = NULL, cran = TRUE,
remote = FALSE, incoming = remote, force_suggests = FALSE,
Expand Down
10 changes: 5 additions & 5 deletions R/dev-mode.r
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#' Activate and deactivate development mode.
#'
#' When activated, \code{dev_mode} creates a new library for storing installed
#' packages. This new library is automatically created when \code{dev_mode} is
#' When activated, `dev_mode` creates a new library for storing installed
#' packages. This new library is automatically created when `dev_mode` is
#' activated if it does not already exist.
#' This allows you to test development packages in a sandbox, without
#' interfering with the other packages you have installed.
#'
#' @param on turn dev mode on (\code{TRUE}) or off (\code{FALSE}). If omitted
#' will guess based on whether or not \code{path} is in
#' \code{\link{.libPaths}}
#' @param on turn dev mode on (`TRUE`) or off (`FALSE`). If omitted
#' will guess based on whether or not `path` is in
#' [.libPaths()]
#' @param path directory to library.
#' @export
#' @examples
Expand Down
8 changes: 4 additions & 4 deletions R/document.r
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#' Use roxygen to document a package.
#'
#' This function is a wrapper for the \code{\link[roxygen2]{roxygenize}()}
#' This function is a wrapper for the [roxygen2::roxygenize()]
#' function from the roxygen2 package. See the documentation and vignettes of
#' that package to learn how to use roxygen.
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' [as.package()] for more information
#' @inheritParams roxygen2::roxygenise
#' @seealso \code{\link[roxygen2]{roxygenize}},
#' \code{browseVignettes("roxygen2")}
#' @seealso [roxygen2::roxygenize()],
#' `browseVignettes("roxygen2")`
#' @export
document <- function(pkg = ".", roclets = NULL) {
check_suggested("roxygen2")
Expand Down
2 changes: 1 addition & 1 deletion R/github.R
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ github_tag <- function(username, repo, ref = "master") {
#' Retrieve Github personal access token.
#'
#' A github personal access token
#' Looks in env var \code{GITHUB_PAT}
#' Looks in env var `GITHUB_PAT`
#'
#' @keywords internal
#' @export
Expand Down
56 changes: 28 additions & 28 deletions R/install.r
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
#' Install a local development package.
#'
#' Uses \code{R CMD INSTALL} to install the package. Will also try to install
#' Uses `R CMD INSTALL` to install the package. Will also try to install
#' dependencies of the package from CRAN, if they're not already installed.
#'
#' By default, installation takes place using the current package directory.
#' If you have compiled code, this means that artefacts of compilation will be
#' created in the \code{src/} directory. If you want to avoid this, you can
#' use \code{build = TRUE} to first build a package bundle and then install
#' created in the `src/` directory. If you want to avoid this, you can
#' use `build = TRUE` to first build a package bundle and then install
#' it from a temporary directory. This is slower, but keeps the source
#' directory pristine.
#'
#' If the package is loaded, it will be reloaded after installation. This is
#' not always completely possible, see \code{\link{reload}} for caveats.
#' not always completely possible, see [reload()] for caveats.
#'
#' To install a package in a non-default library, use \code{\link[withr]{with_libpaths}}.
#' To install a package in a non-default library, use [withr::with_libpaths()].
#'
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' @param reload if \code{TRUE} (the default), will automatically reload the
#' [as.package()] for more information
#' @param reload if `TRUE` (the default), will automatically reload the
#' package after installing.
#' @param quick if \code{TRUE} skips docs, multiple-architectures,
#' @param quick if `TRUE` skips docs, multiple-architectures,
#' demos, and vignettes, to make installation as fast as possible.
#' @param build if \code{TRUE} \code{\link[pkgbuild]{build}}s the package first:
#' @param build if `TRUE` [pkgbuild::build()]s the package first:
#' this ensures that the installation is completely clean, and prevents any
#' binary artefacts (like \file{.o}, \code{.so}) from appearing in your local
#' binary artefacts (like \file{.o}, `.so`) from appearing in your local
#' package directory, but is considerably slower, because every compile has
#' to start from scratch.
#' @param args An optional character vector of additional command line
#' arguments to be passed to \code{R CMD INSTALL}. This defaults to the
#' value of the option \code{"devtools.install.args"}.
#' @param quiet if \code{TRUE} suppresses output from this function.
#' @param dependencies \code{logical} indicating to also install uninstalled
#' packages which this \code{pkg} depends on/links to/suggests. See
#' argument \code{dependencies} of \code{\link{install.packages}}.
#' @param upgrade If \code{TRUE}, the default, will also update
#' arguments to be passed to `R CMD INSTALL`. This defaults to the
#' value of the option `"devtools.install.args"`.
#' @param quiet if `TRUE` suppresses output from this function.
#' @param dependencies `logical` indicating to also install uninstalled
#' packages which this `pkg` depends on/links to/suggests. See
#' argument `dependencies` of [install.packages()].
#' @param upgrade If `TRUE`, the default, will also update
#' any out of date dependencies.
#' @param build_vignettes if \code{TRUE}, will build vignettes. Normally it is
#' \code{build} that's responsible for creating vignettes; this argument makes
#' @param build_vignettes if `TRUE`, will build vignettes. Normally it is
#' `build` that's responsible for creating vignettes; this argument makes
#' sure vignettes are built even if a build never happens (i.e. because
#' \code{local = TRUE}).
#' @param keep_source If \code{TRUE} will keep the srcrefs from an installed
#' `local = TRUE`).
#' @param keep_source If `TRUE` will keep the srcrefs from an installed
#' package. This is useful for debugging (especially inside of RStudio).
#' It defaults to the option \code{"keep.source.pkgs"}.
#' It defaults to the option `"keep.source.pkgs"`.
#' @param threads number of concurrent threads to use for installing
#' dependencies.
#' It defaults to the option \code{"Ncpus"} or \code{1} if unset.
#' It defaults to the option `"Ncpus"` or `1` if unset.
#' @param force whether to force installation of dependencies even if they
#' have not been updated from the previously installed version.
#' @param ... additional arguments passed to \code{\link{install.packages}}
#' when installing dependencies. \code{pkg} is installed with
#' \code{R CMD INSTALL}.
#' @param ... additional arguments passed to [install.packages()]
#' when installing dependencies. `pkg` is installed with
#' `R CMD INSTALL`.
#' @family package installation
#' @seealso \code{\link{update_packages}} to update installed packages from the
#' source location and \code{\link{with_debug}} to install packages with
#' @seealso [update_packages()] to update installed packages from the
#' source location and [with_debug()] to install packages with
#' debugging flags set.
#' @export
install <-
Expand Down
16 changes: 8 additions & 8 deletions R/lint.r
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
#' Lint all source files in a package.
#'
#' The default lintings correspond to the style guide at
#' \url{http://r-pkgs.had.co.nz/r.html#style}, however it is possible to
#' override any or all of them using the \code{linters} parameter.
#' <http://r-pkgs.had.co.nz/r.html#style>, however it is possible to
#' override any or all of them using the `linters` parameter.
#' @param pkg package description, can be path or package name. See
#' \code{\link{as.package}} for more information
#' [as.package()] for more information
#' @param cache store the lint results so repeated lints of the same content
#' use the previous results.
#' @param ... additional arguments passed to \code{\link[lintr]{lint_package}}
#' @seealso \code{\link[lintr]{lint_package}}, \code{\link[lintr]{lint}}
#' @param ... additional arguments passed to [lintr::lint_package()]
#' @seealso [lintr::lint_package()], [lintr::lint()]
#' @details
#' The lintr cache is by default stored in \code{~/.R/lintr_cache/} (this can
#' be configured by setting \code{options(lintr.cache_directory)}). It can be
#' cleared by calling \code{\link[lintr]{clear_cache}}.
#' The lintr cache is by default stored in `~/.R/lintr_cache/` (this can
#' be configured by setting `options(lintr.cache_directory)`). It can be
#' cleared by calling [lintr::clear_cache()].
#' @export
lint <- function(pkg = ".", cache = TRUE, ...) {
check_suggested("lintr")
Expand Down
Loading

0 comments on commit 5d866d4

Please sign in to comment.