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

swh:1:snp:a4c99a50dc49f82b591f268001b320f8c3ca0041
  • Code
  • Branches (42)
  • Releases (0)
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.96
    • refs/tags/0.97-1
    • refs/tags/1.0-1
    • refs/tags/1.0-2
    • refs/tags/1.0-3
    • refs/tags/1.0-4
    • refs/tags/1.0-5
    • refs/tags/1.0-6
    • refs/tags/1.0-6.1
    • refs/tags/R-2.10.0
    • refs/tags/R-2.10.1
    • refs/tags/R-2.11.0
    • refs/tags/R-2.11.1
    • refs/tags/R-2.12.0
    • refs/tags/R-2.12.1
    • refs/tags/R-2.12.2
    • refs/tags/R-2.13.0
    • refs/tags/R-2.13.1
    • refs/tags/R-2.13.2
    • refs/tags/R-2.14.0
    • refs/tags/R-2.14.1
    • refs/tags/R-2.14.2
    • refs/tags/R-2.15.0
    • refs/tags/R-2.15.1
    • refs/tags/R-2.15.2
    • refs/tags/R-2.15.3
    • refs/tags/R-2.6.0
    • refs/tags/R-2.6.1
    • refs/tags/R-2.6.2
    • refs/tags/R-2.7.0
    • refs/tags/R-2.7.1
    • refs/tags/R-2.7.2
    • refs/tags/R-2.8.0
    • refs/tags/R-2.8.1
    • refs/tags/R-2.9.0
    • refs/tags/R-2.9.1
    • refs/tags/R-2.9.2
    • refs/tags/R-3.0.0
    • refs/tags/R-3.0.1
    • refs/tags/R-3.0.2
    • refs/tags/R-3.0.3
    No releases to show
  • 46ec0e1
  • /
  • man
  • /
  • runExample.Rd
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.

  • content
  • directory
  • revision
  • snapshot
content badge Iframe embedding
swh:1:cnt:e5dcfe093d6267cb626d54cf50653961e5c02ca5
directory badge Iframe embedding
swh:1:dir:b8e8ff44b5e9724f390de5aae681dc35a28d4b65
revision badge
swh:1:rev:635622b024294f87a1442a50ad662642f5586aa7
snapshot badge
swh:1:snp:a4c99a50dc49f82b591f268001b320f8c3ca0041
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.

  • content
  • directory
  • revision
  • snapshot
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 ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: 635622b024294f87a1442a50ad662642f5586aa7 authored by jmc on 14 July 2008, 00:00:00 UTC
version 1.0-4
Tip revision: 635622b
runExample.Rd
\name{runExample}
\alias{runExample}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{Run or access example files}
\description{
  This function finds and runs a file,  usually of R code.  The
  function is specialized to look for examples included in the package
  and based on material in \emph{Software for Data Analysis}, but can
  be used for other directories containing source files as well.
}
\usage{
runExample(what, where = , run = TRUE, ..., echo = TRUE, prompt.echo, wd)
}
%- maybe also 'usage' for other objects documented here.
\arguments{
  \item{what}{ Identifies the example to be run.  Can be either a  character string name of the file to be run,
      possibly without the suffix or the page in  \emph{Software for
        Data Analysis} where the example appears.  See
      \code{\link{exampleFiles}} for details. }
  \item{where}{ The character string name of the package or directory
      in which the files are to be found.  By
      default, and usually, it is
      the \code{SoDA} package.  If a package name is given, that
      package must have an \code{"Examples"} directory.}
  \item{run}{ Should the example code be run, or only parsed, assuming
    it is R source code?}
  \item{\dots, echo, prompt.echo}{ Any optional arguments to the \code{\link{source}}
      function, assuming \code{run} is \code{TRUE}. The default for
      \code{prompt.echo} is constructed from an abbreviation of the
      file name. }
  \item{wd}{ The working directory in which to run the example. If the
      argument is missing and \code{where} is a package, the working
      directory is the package directory, which is also the parent
      directory of the \code{Examples} directory.

      If \code{where} is a directory and not a package, and \code{wd}
      is missing, then the working directory is not changed.
      Otherwise, the working directory is set before running the
      example and reset after.  As you would hope, this argument is
      ignored if \code{run} is \code{FALSE}.
      }
}
\value{
  If the file is an R source file, the function returns either the
  value from \code{source} or the parsed version of the file,
  according to whether \code{run} is \code{TRUE}.

  For non-R files, the value is currently just the character vector
  containing the lines of the file.  Future versions may be a little
  more clever.
}
\seealso{\code{\link{demoSource}} for a more interactive way to run a
  file of R code, and \code{\link{exampleFiles}} for direct access to
  the path of the file. }
\references{
Chambers, John M.(2008) \emph{Software for Data Analysis}, Springer.
}
\examples{
\dontrun{
runExample("madCall")  # run file "madCall.R"
runExample(53) # the example appearing on page 53 of the book.
}
}
\keyword{programming }

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