Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Revision df465aa02367bc8bf2fa3f2e3827be5f8713569a authored by Hadley Wickham on 03 December 2021, 09:00:02 UTC, committed by cran-robot on 03 December 2021, 09:00:02 UTC
version 2.0.1
1 parent be39bf7
  • Files
  • Changes
  • 2000f0b
  • /
  • R
  • /
  • test.R
Raw File Download
Permalinks

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • revision
  • directory
  • content
revision badge
swh:1:rev:df465aa02367bc8bf2fa3f2e3827be5f8713569a
directory badge Iframe embedding
swh:1:dir:367dbd97ccdd73e773f4be611a8fbfb5f743c97f
content badge Iframe embedding
swh:1:cnt:838999b162f5a9b443bf09b84fd25d44d7ad07a8
Citations

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • revision
  • directory
  • content
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
test.R
#' Test case: lists
#'
#' @noMd
#' @description
#'
#' \subsection{Bulleted list}{
#' \itemize{
#'   \item a
#'   \item This is an item...
#'
#'     That spans multiple paragraphs.
#' }
#' }
#'
#' \subsection{Bulleted list (single item)}{
#' \itemize{\item a}
#' }
#'
#' \subsection{Numbered list}{
#' \enumerate{
#'   \item a
#'   \item b
#' }
#' }
#'
#' \subsection{Definition list}{
#' \describe{
#'   \item{short}{short}
#'   \item{short}{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
#'   eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad
#'   minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
#'   ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
#'   voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
#'   sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
#'   mollit anim id est laborum.}
#'   \item{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
#'   eiusmod tempor incididunt ut labore et dolore magna aliqua.}{short}
#'   \item{Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
#'   eiusmod tempor incididunt ut labore et dolore magna aliqua.}{Lorem ipsum
#'   adipiscing elit, sed do  eiusmod tempor incididunt ut labore et dolore ad
#'   minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip
#'   ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
#'   voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur
#'   sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
#'   mollit anim id est laborum.}
#' }
#' }
#' @keywords internal
#' @family tests
#' @name test-lists
NULL

#' Test case: links
#'
#' ```{r}
#' magrittr::subtract(10, 1)
#' ```
#'
#' @name test-links
#' @keywords internal
#' @family tests
#' @examples
#' magrittr::subtract(10, 1)
#'
#' library(magrittr, warn.conflicts = FALSE)
#' subtract(10, 1)
NULL

#' Test case: figures
#'
#' \figure{bacon.jpg}
#'
#' @name test-figures
#' @keywords internal
#' @family tests
#' @examples
#' x <- seq(0, 2 * pi, length.out = 25)
#' plot(x, sin(x))
#'
#' plot(1:10)
#' lines(1:10)
#' text(2, 5, "Hello", srt = 30, cex = 2)
NULL

#' Test case: don't
#'
#' @name test-dont
#' @keywords internal
#' @family tests
#' @examples
#' \dontrun{
#'   stop("This is an error!", call. = FALSE)
#' }
#'
#' # Inline \donttest is silently ommitted
#' \donttest{message("Hi!")}
#'
#' # Block \donttest indicated with comments
#' \donttest{
#' # This is a comment
#' 1 + 3
#' }
#'
#' # And works even when not at the top level
#' if (TRUE) {
#'   \donttest{
#'   1 + 2
#'   }
#' }
#'
#' answer <- 1
#' \dontshow{
#' answer <- 42
#' }
#' answer # should be 42
#'
#' # To hide the \dontshow part, for conditional examples
#' \dontshow{if (FALSE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
#' answer <- 43
#' \dontshow{\}) # examplesIf}
#' answer # should be still 42
#'
#' # But this one runs, and the condition is hidden
#' \dontshow{if (TRUE) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf}
#' answer <- 43
#' \dontshow{\}) # examplesIf}
#' answer

NULL

#' Test case: params
#'
#' @name test-params
#' @param ... ellipsis
#' @keywords internal
#' @family tests
NULL

#' Test case: output styles
#'
#' @name test-output-styles
#' @keywords internal
#' @family tests
#'
#' @examples
#' # This example illustrates some important output types
#' # The following output should be wrapped over multiple lines
#' a <- 1:100
#' a
#'
#' cat("This some text!\n")
#' message("This is a message!")
#' warning("This is a warning!")
#'
#' # This is a multi-line block
#' {
#'   1 + 2
#'   2 + 2
#' }
NULL

#' Test case: long-lines
#'
#' The example results should have the copy button correctly placed when
#' scrollings
#'
#' @name test-long-lines
#' @keywords internal
#' @family tests
#' @examples
#' pkgdown:::ruler()
#'
#' cat(rep("x ", 100), sep = "")
#' cat(rep("xy", 100), sep = "")
#' cat(rep("x ", 100), sep = "")
#' cat(rep("xy", 100), sep = "")
NULL

#' Test case: crayon
#'
#' @name test-crayon
#' @keywords internal
#' @family tests
#'
#' @examples
#' cat(crayon::red("This is red"), "\n")
#' cat(crayon::blue("This is blue"), "\n")
#'
#' message(crayon::green("This is green"))
#'
#' warning(crayon::bold("This is bold"))
NULL

#' Test case: preformatted blocks & syntax highlighting
#'
#' Manual test cases for various ways of embedding code in sections.
#' All code blocks should have copy and paste button.
#'
#' # Should be highlighted
#'
#' Valid R code in `\preformatted{}`:
#'
#' ```
#' mean(a + 1)
#' ```
#'
#' R code in `R` block:
#'
#' ```R
#' mean(a + 1)
#' ```
#'
#' R code in `r` block:
#'
#' ```R
#' mean(a + 1)
#' ```
#'
#' Yaml
#'
#' ```yaml
#' yaml: [a, 1]
#' ```
#'
#' # Shouldn't be highlighted
#'
#' Non-R code in `\preformatted{}`
#'
#' ```
#' yaml: [a, b, c]
#' ```
#'
#' @name test-verbatim
#' @keywords internal
#' @family tests
NULL

#' Index
#'
#' @aliases test-index
#' @name index
#' @keywords internal
#' @family tests
NULL

#' Test case: \Sexpr[stage=render,results=rd]{"sexpr"}
#'
#' @name test-sexpr-title
#' @keywords internal
#' @family tests
NULL
The diff you're trying to view is too large. Only the first 1000 changed files have been loaded.
Showing with 0 additions and 0 deletions (0 / 0 diffs computed)
swh spinner

Computing file changes ...

back to top

Software Heritage — Copyright (C) 2015–2025, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Contact— JavaScript license information— Web API