Version: 0.46.0
Depends: R (≥ 2.14.0)
Imports: methods, stats, tools, utils, R.methodsS3 (≥ 1.8.0), R.oo (≥ 1.23.0), R.utils, R.cache, digest
Suggests: tcltk, markdown, knitr, R.devices, base64enc, ascii
SuggestsNote: Recommended: R.devices, base64enc, markdown
VignetteBuilder: R.rsp
Title: Dynamic Generation of Scientific Reports
Author: Henrik Bengtsson [aut, cre, cph]
Maintainer: Henrik Bengtsson <henrikb@braju.com>
Description: The RSP markup language makes any text-based document come alive. RSP provides a powerful markup for controlling the content and output of LaTeX, HTML, Markdown, AsciiDoc, Sweave and knitr documents (and more), e.g. 'Today's date is <%=Sys.Date()%>'. Contrary to many other literate programming languages, with RSP it is straightforward to loop over mixtures of code and text sections, e.g. in month-by-month summaries. RSP has also several preprocessing directives for incorporating static and dynamic contents of external files (local or online) among other things. Functions rstring() and rcat() make it easy to process RSP strings, rsource() sources an RSP file as it was an R script, while rfile() compiles it (even online) into its final output format, e.g. rfile('report.tex.rsp') generates 'report.pdf' and rfile('report.md.rsp') generates 'report.html'. RSP is ideal for self-contained scientific reports and R package vignettes. It's easy to use - if you know how to write an R script, you'll be up and running within minutes.
License: LGPL-2.1 | LGPL-3 [expanded from: LGPL (≥ 2.1)]
URL: https://henrikbengtsson.github.io/R.rsp/, https://github.com/HenrikBengtsson/R.rsp
BugReports: https://github.com/HenrikBengtsson/R.rsp/issues
LazyLoad: TRUE
NeedsCompilation: no
Packaged: 2024-02-17 16:07:15 UTC; henrik
Repository: CRAN
Date/Publication: 2024-02-17 18:30:02 UTC

Package R.rsp

Description

The RSP markup language makes any text-based document come alive. RSP provides a powerful markup for controlling the content and output of LaTeX, HTML, Markdown, AsciiDoc, Sweave and knitr documents (and more), e.g. 'Today's date is <%=Sys.Date()%>'. Contrary to many other literate programming languages, with RSP it is straightforward to loop over mixtures of code and text sections, e.g. in month-by-month summaries. RSP has also several preprocessing directives for incorporating static and dynamic contents of external files (local or online) among other things. Functions rstring() and rcat() make it easy to process RSP strings, rsource() sources an RSP file as it was an R script, while rfile() compiles it (even online) into its final output format, e.g. rfile('report.tex.rsp') generates 'report.pdf' and rfile('report.md.rsp') generates 'report.html'. RSP is ideal for self-contained scientific reports and R package vignettes. It's easy to use - if you know how to write an R script, you'll be up and running within minutes.

Installation

To install this package, call install.packages("R.rsp").

To get started

We recommend that you start by reading one of the 'vignettes':

  1. A 5 minute slideshow covering the basics of RSP.

  2. Detailed description of the RSP markup language.

  3. A one-page RSP reference card.

  4. How to use RSP for package vignettes.

  5. How to use plain LaTeX for package vignettes.

  6. How to use static PDF or HTML package vignettes.

Then, when you're ready to try it yourself, these are commands you can start with:

  1. Play with rcat(), which works like cat() but also processed RSP expressions, e.g. rcat("A random number: <%=sample(100, size=1)%>\n").

  2. To source a RSP document as you do with R scripts, use rsource(), e.g. rsource("report.md.rsp") which will run the RSP and display the output as it appears.

  3. To compile a RSP document to a final document, use rfile(), e.g. rfile("report.md.rsp") outputs Markdown file 'report.md' which is automatically compiled into a final 'report.html'.

Acknowledgments

Several of the post-processing features of this package utilize packages such as base64enc, knitr, and markdown. Not enough credit can be given to the authors and contributors of those packages. Thank you for your great work.

License

The releases of this package is licensed under LGPL version 2.1 or newer.

The development code of the packages is under a private licence (where applicable) and patches sent to the author fall under the latter license, but will be, if incorporated, released under the "release" license above.

How to cite this package

Bengtsson H (2024). R.rsp: Dynamic Generation of Scientific Reports. R package version 0.46.0, https://github.com/HenrikBengtsson/R.rsp, https://henrikbengtsson.github.io/R.rsp/.

Author(s)

Henrik Bengtsson


Reads the content of a local or an online text file

Description

Reads the content of a local or an online text file.

Usage

.readText(con, ..., maxAge=getOption("R.rsp::downloadIfOlderThan", -Inf))

Arguments

con

A character string specifying a local file or a URL, or a connection.

...

Not used.

maxAge

A numeric scalar specifying the maximum age (in seconds) of cached URL contents before downloading and recaching. If zero or less, the URL will always be downloaded.

Value

Returns a character string.

Caching URL

When reading online URLs, it may take time a significant time to read its content. If the content is changing rarely, it is possible to cache the content locally. If a cached version is found, then it is read instead. It is possible to control how often a file should be recached. If the cache is older than argument maxAge (in seconds), then the file is redownloaded and recached.

Newline substitution

All occurrences of \r\n and \r are replaced with \n such that all lines are ending in \n regardless of encoding.

Author(s)

Henrik Bengtsson


The FileRspResponse class

Description

Package: R.rsp
Class FileRspResponse

Object
~~|
~~+--RspResponse
~~~~~~~|
~~~~~~~+--FileRspResponse

Directly known subclasses:
HttpDaemonRspResponse

public static class FileRspResponse
extends RspResponse

Usage

FileRspResponse(file=stdout(), path=NULL, overwrite=FALSE, ...)

Arguments

file

A filename or a connection to write responses to.

path

An optional path to the file.

overwrite

If FALSE, an error is thrown if the output file already exists, otherwise not.

...

Not used.

Fields and Methods

Methods:

flush -
getAbsolutePath Gets the absolute pathname to the current RSP file.
getName Gets the (base)name of the current RSP file.
getOutput Gets the output for an RSP response.
getPath Gets the path of the directory of the current RSP file.
writeResponse -

Methods inherited from RspResponse:
flush, writeResponse

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


The HtmlRspLanguage class

Description

Package: R.rsp
Class HtmlRspLanguage

Object
~~|
~~+--RspLanguage
~~~~~~~|
~~~~~~~+--HtmlRspLanguage

Directly known subclasses:

public static class HtmlRspLanguage
extends RspLanguage

Usage

HtmlRspLanguage(...)

Arguments

...

Arguments passed to the constructor of the RspLanguage.

Fields and Methods

Methods:

escape -
getComment -
getVerbatim -

Methods inherited from RspLanguage:
escape, getComment, getLanguage, getNewline, getVerbatim

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


The HttpDaemon class

Description

Package: R.rsp
Class HttpDaemon

Object
~~|
~~+--HttpDaemon

Directly known subclasses:

public static class HttpDaemon
extends Object

A minimalistic HTTP daemon (web server) that also preprocesses RSP.

Usage

HttpDaemon(...)

Arguments

...

Not used.

Details

The actual server is written in Tcl such that it runs in a non-blocking mode, which means that the R prompt will be available for other things. This class is tightly coupled with the source code of the Tcl script.

For security reasons, the server only accept connections from the local host (127.0.0.1). This lowers the risk for external computers to gain access to the R session. This is asserted by the accept_connect Tcl procedure in r-httpd.tcl (located in system.file("tcl/", package="R.rsp")). If access from other hosts are wanted, then this procedure needs to be modified.

The Tcl server was written by Steve Uhlers, and later adopted for R by Philippe Grosjean and Tom Short (Rpad package author) [1].

Fields and Methods

Methods:

appendRootPaths Appends and inserts new paths to the list of known root directories.
as.character Returns a short string describing the HTTP daemon.
finalize -
getConfig Retrieves the server's 'config' structure from Tcl.
getCount -
getDefaultFilenamePattern Gets the default filename pattern to be loaded by the HTTP daemon.
getHttpRequest Gets the HTTP request.
getPort Gets the socket port of the HTTP daemon.
getRootPaths Gets the root directories of the HTTP daemon.
insertRootPaths -
isStarted Checks if the HTTP daemon is started.
openUrl Starts the HTTP daemon and launches the specified URL.
processRsp Processes an RSP page.
restart Restarts the HTTP daemon.
setCount -
setRootPaths Sets a new set of root directories for the HTTP daemon.
sourceTcl Loads the Tcl source for the HTTP daemon into R.
start Starts the HTTP daemon.
startHelp Starts the HTTP daemon and launches the help page.
terminate Terminates the HTTP daemon.
writeResponse Writes a string to the HTTP output connection.

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson

References

[1] Rpad package, Tom Short, 2005.

Examples

if (interactive()) {
  if (!HttpDaemon$isStarted()) {
    # Start the web server
    rootPath <- system.file("rsp", package="R.rsp")
    HttpDaemon$start(rootPath=rootPath, port=8074, default="^index[.](html|.*)$")
  }
 
  browseURL("http://127.0.0.1:8074/")
}

Appends and inserts new paths to the list of known root directories

Description

Appends and inserts new paths to the list of known root directories, if started.

Usage

## Static method (use this):
## HttpDaemon$appendRootPaths(paths, ...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
appendRootPaths(static, paths, ...)

Arguments

paths

A vector of paths.

...

Not used.

Value

Returns (invisibly) the previously known root directories.

Author(s)

Henrik Bengtsson

See Also

*getRootPaths() For more information see HttpDaemon.


Retrieves the server's 'config' structure from Tcl

Description

Retrieves the server's 'config' structure from Tcl.

Usage

## Static method (use this):
## HttpDaemon$getConfig(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
getConfig(static, ...)

Arguments

...

Not used.

Value

Returns a tclArray object.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Gets the default filename pattern to be loaded by the HTTP daemon

Description

Gets the default filename pattern to be loaded by the HTTP daemon, if started.

Usage

## Static method (use this):
## HttpDaemon$getDefaultFilenamePattern(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
getDefaultFilenamePattern(static, ...)

Arguments

...

Not used.

Value

Returns an character string if started, otherwise NA.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Gets the HTTP request

Description

Gets the HTTP request.

Usage

## Static method (use this):
## HttpDaemon$getHttpRequest(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
getHttpRequest(static, ...)

Arguments

...

Not used.

Value

Returns a HttpRequest object.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Gets the socket port of the HTTP daemon

Description

Gets the socket port of the HTTP daemon, if started.

Usage

## Static method (use this):
## HttpDaemon$getPort(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
getPort(static, ...)

Arguments

...

Not used.

Value

Returns an integer if started, otherwise NA.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Gets the root directories of the HTTP daemon

Description

Gets the root directories of the HTTP daemon.

Usage

## Static method (use this):
## HttpDaemon$getRootPaths(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
getRootPaths(static, ...)

Arguments

...

Not used.

Value

Returns a vector of character string if started, otherwise NA.

Author(s)

Henrik Bengtsson

See Also

*setRootPaths() *appendRootPaths() For more information see HttpDaemon.


Checks if the HTTP daemon is started

Description

Checks if the HTTP daemon is started.

Usage

## Static method (use this):
## HttpDaemon$isStarted(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
isStarted(x, ...)

Arguments

...

Not used.

Value

Returns TRUE if the server is started, otherwise FALSE.

Author(s)

Henrik Bengtsson

See Also

*start() and *terminate(). For more information see HttpDaemon.


Processes an RSP page

Description

Processes an RSP page.

Usage

## Static method (use this):
## HttpDaemon$processRsp(pathname=tcltk::tclvalue("mypath"),
##   version=getOption("R.rsp/HttpDaemon/RspVersion", "1.0.0"), ...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
processRsp(static=getStaticInstance(HttpDaemon), pathname=tcltk::tclvalue("mypath"),
  version=getOption("R.rsp/HttpDaemon/RspVersion", "1.0.0"), ...)

Arguments

pathname

The RSP file to be processed.

version

The version of the RSP processor to use.

...

Not used.

Value

Returns nothing.

Settings

The R.rsp package implements different RSP engines. It is possible to specify which version the Tcl HTTP daemon should use via the option R.rsp/HttpDaemon/RspVersion. The default is now to use the new RSP engine, which corresponds options("R.rsp/HttpDaemon/RspVersion"="1.0.0"). The old legacy RSP engine "0.1.0" is defunct.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Restarts the HTTP daemon

Description

Restarts the HTTP daemon.

Usage

## Static method (use this):
## HttpDaemon$restart(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
restart(static, ...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

*isStarted(). *start(). *terminate(). For more information see HttpDaemon.


Sets a new set of root directories for the HTTP daemon

Description

Sets a new set of root directories for the HTTP daemon, if started.

Usage

## Static method (use this):
## HttpDaemon$setRootPaths(paths, ...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
setRootPaths(static, paths, ...)

Arguments

paths

A vector of paths.

...

Not used.

Value

Returns (invisibly) the previously known root directories.

Author(s)

Henrik Bengtsson

See Also

*getRootPaths() *appendRootPaths() For more information see HttpDaemon.


Loads the Tcl source for the HTTP daemon into R

Description

Loads the Tcl source for the HTTP daemon into R.

Usage

## Static method (use this):
## HttpDaemon$sourceTcl(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
sourceTcl(static, ...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Starts the HTTP daemon

Description

Starts the HTTP daemon. Currently, only one HTTP daemon can run at each time, regardless of port used.

Usage

## Static method (use this):
## HttpDaemon$start(rootPaths=NULL, port=8080, default="^index[.](html|.*)$", ...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
start(x, rootPaths=NULL, port=8080, default="^index[.](html|.*)$", ...)

Arguments

rootPaths

The path(s) to act as the root of the web server file system. Files in parent directories of the root, will not be accessible. If NULL, the preset paths will be used, cf. *setRootPaths().

port

The socket port the server listens to.

default

The default filename pattern to be retrieved if not specified.

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

*setRootPaths(). *isStarted(). *terminate(). *restart(). For more information see HttpDaemon.


Terminates the HTTP daemon

Description

Terminates the HTTP daemon.

Usage

## Static method (use this):
## HttpDaemon$terminate(...)

## Don't use the below:
## S3 method for class 'HttpDaemon'
terminate(static, ...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

*isStarted(). *start(). *restart(). For more information see HttpDaemon.


The HttpDaemonRspResponse class

Description

Package: R.rsp
Class HttpDaemonRspResponse

Object
~~|
~~+--RspResponse
~~~~~~~|
~~~~~~~+--FileRspResponse
~~~~~~~~~~~~|
~~~~~~~~~~~~+--HttpDaemonRspResponse

Directly known subclasses:

public static class HttpDaemonRspResponse
extends FileRspResponse

An instance of class HttpDaemonRspResponse, which extends the RspResponse class, is a buffer for output (response) sent to an HttpDaemon. It provides a method writeResponse() for writing output and a method flush() for flush the written output to the HTTP daemon.

Usage

HttpDaemonRspResponse(httpDaemon=NULL, ...)

Arguments

httpDaemon

An HttpDaemon object.

...

Not used.

Details

The purpose of this method is to provide partial writing of HTTP response such that, for instance, a web browser can display parts of an HTML page while the rest is generated. Note that this is only supported by the HTTP v1.1 protocol.

Note: The minimalistic HTTP daemon (written in Tcl) used internally currently only supports HTTP v1.0. In other words, although this class is used already, the output is only flushed at the end.

Fields and Methods

Methods:

flush -
writeResponse -

Methods inherited from FileRspResponse:
flush, getAbsolutePath, getName, getOutput, getPath, writeResponse

Methods inherited from RspResponse:
flush, writeResponse

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson

See Also

HttpDaemon.


The HttpRequest class

Description

Package: R.rsp
Class HttpRequest

Object
~~|
~~+--HttpRequest

Directly known subclasses:

public static class HttpRequest
extends Object

Usage

HttpRequest(requestUri=NULL, parameters=list(), ...)

Arguments

requestUri

A character string of the requested URI.

parameters

A named list of parameter values.

...

Not used.

Fields and Methods

Methods:

as.character Returns a short string describing the HTTP request.
getContentLength Gets the length of contents.
getContentType Gets the MIME type of the body of the request.
getContextPath -
getDateHeader -
getHeader -
getParameter Gets a parameter.
getParameters Gets all parameters.
getProtocol Gets the name and version of the protocol used to make this request.
getQueryString -
getRealPath Gets the file system path for a given URI.
getRemoteAddress Gets the IP address of the client that sent the request.
getRemoteHost Gets the fully qualified name of the client that sent the request.
getRemoteUser -
getRequestUri -
getRequestUrl -
getScheme Gets the scheme used to make this request.
getServerName Gets the host name of the server that reviewed the request.
getServerPort Gets the port number on which this request was received.
getServletPath -
hasParameter Checks if a parameter exists.
nbrOfParameters Gets the number of parameters.

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


Non-documented objects

Description

This page contains aliases for all "non-documented" objects that R CMD check detects in this package.

Almost all of them are generic functions that have specific document for the corresponding method coupled to a specific class. Other functions are re-defined by setMethodS3() to default methods. Neither of these two classes are non-documented in reality. The rest are deprecated methods.

Author(s)

Henrik Bengtsson


The RRspPackage class

Description

Package: R.rsp
Class RRspPackage

Object
~~|
~~+--Package
~~~~~~~|
~~~~~~~+--RRspPackage

Directly known subclasses:

public static class RRspPackage
extends Package

Usage

RRspPackage(...)

Arguments

...

Not used.

Fields and Methods

Methods:

capabilitiesOf Checks which tools are supported.
isCapableOf -

Methods inherited from Package:
as.character, getAuthor, getBundle, getBundlePackages, getChangeLog, getClasses, getContents, getDataPath, getDate, getDescription, getDescriptionFile, getDocPath, getEnvironment, getExamplePath, getHistory, getHowToCite, getLicense, getMaintainer, getName, getNews, getPath, getPosition, getTitle, getUrl, getVersion, isLoaded, isOlderThan, ll, load, showChangeLog, showContents, showDescriptionFile, showHistory, showHowToCite, showNews, startupMessage, unload

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


Checks which tools are supported

Description

Checks which tools are supported.

Usage

## Static method (use this):
## RRspPackage$capabilitiesOf(what=NULL, force=FALSE, ...)

## Don't use the below:
## S3 method for class 'RRspPackage'
capabilitiesOf(static, what=NULL, force=FALSE, ...)

Arguments

what

Optional character vector of which tools to check.

force

If TRUE, cached results are ignored, otherwise not.

...

Not used.

Value

Returns a logical named character vector.

Author(s)

Henrik Bengtsson

Examples

# Display which tools are supported by the package
print(capabilitiesOf(R.rsp))

# Check whether AsciiDoc is supported
print(isCapableOf(R.rsp, "asciidoc"))

# Check whether pandoc v1.12 or newer is supported
print(isCapableOf(R.rsp, "pandoc (>= 1.12)"))

The RspCode class

Description

Package: R.rsp
Class RspCode

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspExpression
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspCode

Directly known subclasses:
RspCodeChunk

public class RspCode
extends RspExpression

An RspCode is an RspExpression that represents a piece of source code, which may or may not be a complete code chunk (expression).

Usage

RspCode(code=character(), echo=FALSE, ...)

Arguments

code

A character string.

echo

If TRUE, code is echoed to the output.

...

Not used.

Fields and Methods

Methods:

asRspString -
getCode Gets the source code.
getEcho Checks whether the source code should be echoed or not.

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspCodeChunk class

Description

Package: R.rsp
Class RspCodeChunk

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspExpression
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspCode
~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~+--RspCodeChunk

Directly known subclasses:

public class RspCodeChunk
extends RspCode

An RspCodeChunk is an RspCode that represents a complete RSP code chunk.

Usage

RspCodeChunk(..., return=FALSE)

Arguments

...

Arguments passed to the constructor of RspCode.

return

If TRUE, the value of the evaluated code chunk is returned.

Fields and Methods

Methods:

asRspString -
getInclude -

Methods inherited from RspCode:
asRspString, getCode, getEcho

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspComment class

Description

Package: R.rsp
Class RspComment

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspComment

Directly known subclasses:

public class RspComment
extends RspConstruct

An RspComment is an RspConstruct that represents an RSP comment, which are of format <%-- ... --%>, <%--- ... ---%> and so on. They can also be so called "empty" RSP comments of format <%-%>, <%--%>, <%---%> and so on.

Usage

RspComment(str=character(), ...)

Arguments

str

A character string.

...

Not used.

Fields and Methods

Methods:

asRspString -
getComment Gets the comment.

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspConstruct class

Description

Package: R.rsp
Class RspConstruct

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct

Directly known subclasses:
RspCode, RspCodeChunk, RspComment, RspCopyDirective, RspCutDirective, RspDirective, RspElseDirective, RspEndcopyDirective, RspEndcutDirective, RspEndifDirective, RspErrorDirective, RspEvalDirective, RspExpression, RspIfDirective, RspIfeqDirective, RspIfneqDirective, RspIncludeDirective, RspIntegerDirective, RspLogicalDirective, RspMetaDirective, RspNumericDirective, RspPageDirective, RspPasteDirective, RspStringDirective, RspText, RspUnknownDirective, RspUnparsedDirective, RspUnparsedExpression, RspVariableDirective, RspVoid

public class RspConstruct
extends RspObject

An RspConstruct object represents an RSP construct, which can either be (i) an RSP text (a plain text section), (ii) an RSP comment, (iii) an RSP preprocessing directive, or (iv) an RSP expression.

Usage

RspConstruct(object=character(), ..., comment=NULL)

Arguments

object

A R object.

...

Arguments passed to RspObject.

comment

An optional character string.

Fields and Methods

Methods:

asRspString Recreates an RSP string from an RspConstruct.
getComment Gets the comment of an RSP construct.
getInclude Checks whether an RSP construct will include text to the output or not.
getSuffixSpecs Gets the suffix specifications.

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspCopyDirective class

Description

Package: R.rsp
Class RspCutDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspCutDirective

Directly known subclasses:
RspCopyDirective

public class RspCutDirective
extends RspDirective

An RspCutDirective and RspPasteDirective are RspDirective that will copy, cut, and paste a set of RspConstruct:s.

Usage

RspCutDirective(value="cut", ..., .validate=TRUE)

Arguments

value

A character string.

...

Additional arguments passed to RspDirective.

.validate

A logical specifying whether the attributes should be validated or not.

Fields and Methods

Methods:
No methods defined.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The abstract RspDirective class

Description

Package: R.rsp
Class RspDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective

Directly known subclasses:
RspCopyDirective, RspCutDirective, RspElseDirective, RspEndcopyDirective, RspEndcutDirective, RspEndifDirective, RspErrorDirective, RspEvalDirective, RspIfDirective, RspIfeqDirective, RspIfneqDirective, RspIncludeDirective, RspIntegerDirective, RspLogicalDirective, RspMetaDirective, RspNumericDirective, RspPageDirective, RspPasteDirective, RspStringDirective, RspUnknownDirective, RspUnparsedDirective, RspVariableDirective

public class RspDirective
extends RspConstruct

An RspDirective is an RspConstruct that represents an RSP preprocessing directive of format <%@ ... %>. The directive is independent of the underlying programming language.

Usage

RspDirective(value=character(), ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspConstruct.

Fields and Methods

Methods:

asRspString -
getNameContentDefaultAttributes -
requireAttributes Asserts that certain attributes exist.

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspDocument class

Description

Package: R.rsp
Class RspDocument

list
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspDocument

Directly known subclasses:

public class RspDocument
extends RspObject

An RspDocument represents a list of RspConstruct:s.

Usage

RspDocument(expressions=list(), ...)

Arguments

expressions

A list of RspConstruct:s and RspDocument:s.

...

Arguments passed to RspObject.

Fields and Methods

Methods:

[ -
[<- -
asRspString -
dropEmptyText Drops all empty RSP text constructs.
evaluate Parses, translates, and evaluates the RSP document.
flatten Flattens an RspDocument.
getPath Gets the path to the source reference of an RSP string.
getSource Gets the source reference of an RSP document.
getType Gets the type of the RspDocument.
mergeTexts Merge neighboring 'text' elements.
parseCutNPasteDirectives -
parseIfElseDirectives -
preprocess Processes all RSP preprocessing directives.
print -
rcat -
rclean -
rcode -
rcompile -
rfile -
rsource -
rstring -
subset Subsets an RspDocument.
toR Translates the RSP document into R source code.
trim Trims each of the RSP constructs.
trimNonText Trims all non-text RSP constructs.

Methods inherited from RspObject:
print

Methods inherited from list:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.data.frame, attachLocally, coerce,ANY,list-method, relist, type.convert, within

Author(s)

Henrik Bengtsson


The RspErrorDirective class

Description

Package: R.rsp
Class RspErrorDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspErrorDirective

Directly known subclasses:

public class RspErrorDirective
extends RspDirective

An RspErrorDirective is an RspDirective that generates an RSP preprocessing error (if processed).

Usage

RspErrorDirective(value="error", ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:
No methods defined.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspEvalDirective class

Description

Package: R.rsp
Class RspEvalDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspEvalDirective

Directly known subclasses:

public class RspEvalDirective
extends RspDirective

An RspEvalDirective is an RspDirective that causes the RSP parser to evaluate a piece of R code (either in a text string or in a file) as it is being parsed.

Usage

RspEvalDirective(value="eval", ...)

Arguments

value

A character string.

...

Optional arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:

getContent Gets the content of the RSP eval directive.
getFile Gets the file attribute.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspException class

Description

Package: R.rsp
Class RspException

Object
~~|
~~+--try-error
~~~~~~~|
~~~~~~~+--condition
~~~~~~~~~~~~|
~~~~~~~~~~~~+--error
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--simpleError
~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~+--Exception
~~~~~~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~~~~~~+--RspException

Directly known subclasses:
RspParseException, RspPreprocessingException

public static class RspException
extends Exception

An RspException is an Exception that is thrown during the processing of an RSP document.

Usage

RspException(...)

Arguments

...

Not used.

Fields and Methods

Methods:
No methods defined.

Methods inherited from Exception:
as.character, getCall, getCalls, getLastException, getMessage, getStackTrace, getWhen, print, printStackTrace, throw

Methods inherited from error:
as.character, throw

Methods inherited from condition:
abort, as.character, conditionCall, conditionMessage, print

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


The RspExpression class

Description

Package: R.rsp
Class RspExpression

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspExpression

Directly known subclasses:
RspCode, RspCodeChunk, RspUnparsedExpression

public class RspExpression
extends RspConstruct

An RspExpression is an RspConstruct of format <% ... %>.

Usage

RspExpression(...)

Arguments

...

Not used.

Fields and Methods

Methods:
No methods defined.

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspFileProduct class

Description

Package: R.rsp
Class RspFileProduct

logical
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspProduct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspFileProduct

Directly known subclasses:

public class RspFileProduct
extends RspProduct

An RspFileProduct is an RspProduct that represents an RSP product in form of a file, e.g. LaTeX, Sweave and knitr documents.

Usage

RspFileProduct(pathname=NA, ..., mustExist=TRUE)

Arguments

pathname

An existing file.

...

Additional arguments passed to RspProduct.

mustExist

If TRUE, it is asserted that the file exists.

Fields and Methods

Methods:

findProcessor -
getFileSize -
getType -
print -
view -

Methods inherited from RspProduct:
!, findProcessor, getType, hasProcessor, print, process, view

Methods inherited from RspObject:
print

Methods inherited from logical:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, as.data.frame, as.raster, coerce,ANY,logical-method, whichVector

Author(s)

Henrik Bengtsson


The RspIfDirective class

Description

Package: R.rsp
Class RspIfDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspIfDirective

Directly known subclasses:
RspIfeqDirective, RspIfneqDirective

public class RspIfDirective
extends RspDirective

An RspIfDirective is an RspDirective that will include or exclude all RspConstruct:s until the next RspEndifDirective based on the preprocessing value of the particular if clause. Inclusion/exclusion can be reversed via an RspElseDirective.

Usage

RspIfDirective(value="if", ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:
No methods defined.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspIncludeDirective class

Description

Package: R.rsp
Class RspIncludeDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspIncludeDirective

Directly known subclasses:

public class RspIncludeDirective
extends RspDirective

An RspIncludeDirective is an RspDirective that causes the RSP parser to include (and parse) an external RSP file.

Usage

RspIncludeDirective(value="include", ...)

Arguments

value

A character string.

...

Optional arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:

getContent Gets the content of the RSP include directive.
getFile Gets the file attribute.
getVerbatim Checks if verbatim include should be used or not.
getWrap Get the wrap length.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspLanguage class

Description

Package: R.rsp
Class RspLanguage

Object
~~|
~~+--RspLanguage

Directly known subclasses:
HtmlRspLanguage

public static class RspLanguage
extends Object

An RspLanguage object specifies what the markup language of the response/output document is, e.g. plain text and HTML. The RspLanguage class provides methods to obtain language specific strings/output such as how newlines and comments are written. The RspLanguage class describes a plain text languages. For HTML see the HtmlRspLanguage subclass.

Usage

RspLanguage(language="plain", ...)

Arguments

language

A character string.

...

Not used.

Fields and Methods

Methods:

escape Escapes a string specifically for a given RSP response language.
getComment Gets a comment string specific for a given RSP response language.
getLanguage Gets the language string.
getNewline Gets the newline string specific for a given RSP response language.
getVerbatim Gets a verbatim string specific for a given RSP response language.

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


The RspMetaDirective class

Description

Package: R.rsp
Class RspMetaDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspVariableDirective
~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~+--RspStringDirective
~~~~~~~~~~~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~~~~~~~~~~~+--RspMetaDirective

Directly known subclasses:

public class RspMetaDirective
extends RspStringDirective

An RspMetaDirective is an RspDirective representing RSP metadata.

Usage

RspMetaDirective(value="meta", ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspStringDirective.

Fields and Methods

Methods:
No methods defined.

Methods inherited from RspVariableDirective:
getInclude

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The abstract RspObject class

Description

Package: R.rsp
Class RspObject

logical
~~|
~~+--RspObject

Directly known subclasses:
RspCode, RspCodeChunk, RspComment, RspConstruct, RspCopyDirective, RspCutDirective, RspDirective, RspDocument, RspElseDirective, RspEndcopyDirective, RspEndcutDirective, RspEndifDirective, RspErrorDirective, RspEvalDirective, RspExpression, RspFileProduct, RspIfDirective, RspIfeqDirective, RspIfneqDirective, RspIncludeDirective, RspIntegerDirective, RspLogicalDirective, RspMetaDirective, RspNumericDirective, RspPageDirective, RspPasteDirective, RspProduct, RspRSourceCode, RspShSourceCode, RspSourceCode, RspString, RspStringDirective, RspStringProduct, RspText, RspUnknownDirective, RspUnparsedDirective, RspUnparsedExpression, RspVariableDirective, RspVoid

public class RspObject
extends logical

An RspObject represents an instance a specific RSP class.

Usage

RspObject(value=NA, attrs=list(), ...)

Arguments

value

An R object.

attrs

RSP attributes as a named list, e.g. type, language, and source.

...

Additional named RSP attributes.

Fields and Methods

Methods:

print Prints a summary of an RSP object.

Methods inherited from logical:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, as.data.frame, as.raster, coerce,ANY,logical-method, whichVector

Author(s)

Henrik Bengtsson


The RspPage class

Description

Package: R.rsp
Class RspPage

Object
~~|
~~+--RspPage

Directly known subclasses:

public static class RspPage
extends Object

Usage

RspPage(pathname=NULL, ...)

Arguments

pathname

A character string.

...

Not used.

Fields and Methods

Methods:

getAbsolutePath Gets the absolute pathname to the current RSP file.
getName Gets the (base)name of the current RSP file.
getPath Gets the path of the directory of the current RSP file.

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


The RspPageDirective class

Description

Package: R.rsp
Class RspPageDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspPageDirective

Directly known subclasses:

public class RspPageDirective
extends RspDirective

An RspPageDirective is an RspDirective that annotates the content of the RSP document, e.g. the content type.

Usage

RspPageDirective(value="page", ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:

getType Gets the content type.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspParser class

Description

Package: R.rsp
Class RspParser

logical
~~|
~~+--RspParser

Directly known subclasses:

public class RspParser
extends logical

An RspParser is parser for the RSP language.

Usage

RspParser(...)

Arguments

...

Not used.

Fields and Methods

Methods:

parseDocument Parse an RSP string into and RSP document.
parseRaw Parses the string into blocks of text and RSP.

Methods inherited from logical:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, as.data.frame, as.raster, coerce,ANY,logical-method, whichVector

Author(s)

Henrik Bengtsson


The RspProduct class

Description

Package: R.rsp
Class RspProduct

logical
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspProduct

Directly known subclasses:
RspFileProduct, RspRSourceCode, RspShSourceCode, RspSourceCode, RspStringProduct

public abstract class RspProduct
extends RspObject

An RspProduct object represents an RSP product generated by processing an RSP document.

Usage

RspProduct(object=NA, ...)

Arguments

object

The RSP product.

...

Arguments passed to RspObject.

Fields and Methods

Methods:

! -
findProcessor Locates a processor for an RSP product.
getType Gets the type of an RSP product.
hasProcessor Checks whether a processor exist or not for an RSP product.
print -
process Processes an RSP file product.
view Views the RSP product.

Methods inherited from RspObject:
print

Methods inherited from logical:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, as.data.frame, as.raster, coerce,ANY,logical-method, whichVector

Author(s)

Henrik Bengtsson


The RspRSourceCode class

Description

Package: R.rsp
Class RspRSourceCode

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspProduct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspSourceCode
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspRSourceCode

Directly known subclasses:

public abstract class RspRSourceCode
extends RspSourceCode

An RspRSourceCode object is an RspSourceCode holding R source code.

Usage

RspRSourceCode(...)

Arguments

...

character strings.

Fields and Methods

Methods:

evaluate Parses and evaluates the R code.
findProcessor -
parseCode Parses the R code.
rcat -
rfile -
rsource -
tangle -
tidy -

Methods inherited from RspSourceCode:
evaluate, print, rstring, tangle, tidy

Methods inherited from RspProduct:
!, findProcessor, getType, hasProcessor, print, process, view

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspRSourceCodeFactory class

Description

Package: R.rsp
Class RspRSourceCodeFactory

character
~~|
~~+--RspSourceCodeFactory
~~~~~~~|
~~~~~~~+--RspRSourceCodeFactory

Directly known subclasses:

public class RspRSourceCodeFactory
extends RspSourceCodeFactory

An RspRSourceCodeFactory is an RspSourceCodeFactory for the R language.

Usage

RspRSourceCodeFactory(...)

Arguments

...

Not used.

Fields and Methods

Methods:

exprToCode -
getCompleteCode -

Methods inherited from RspSourceCodeFactory:
exprToCode, getCompleteCode, getLanguage, makeSourceCode, toSourceCode

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspResponse class

Description

Package: R.rsp
Class RspResponse

Object
~~|
~~+--RspResponse

Directly known subclasses:
FileRspResponse, HttpDaemonRspResponse

public abstract static class RspResponse
extends Object

An abstract class that provides basic methods to write and flush output to the generated document.

Usage

RspResponse(...)

Arguments

...

Not used.

Fields and Methods

Methods:

flush Flushes the response buffer.
writeResponse Writes an RSP response to the predefined output.

Methods inherited from Object:
$, $<-, [[, [[<-, as.character, attach, attachLocally, clearCache, clearLookupCache, clone, detach, equals, extend, finalize, getEnvironment, getFieldModifier, getFieldModifiers, getFields, getInstantiationTime, getStaticInstance, hasField, hashCode, ll, load, names, objectSize, print, save

Author(s)

Henrik Bengtsson


The RspShSourceCode class

Description

Package: R.rsp
Class RspShSourceCode

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspProduct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspSourceCode
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspShSourceCode

Directly known subclasses:

public abstract class RspShSourceCode
extends RspSourceCode

An RspShSourceCode object is an RspSourceCode holding shell code.

Usage

RspShSourceCode(...)

Arguments

...

character strings.

Fields and Methods

Methods:

evaluate Evaluates the shell (sh) code.
findProcessor -
rcat -
rfile -

Methods inherited from RspSourceCode:
evaluate, print, rstring, tangle, tidy

Methods inherited from RspProduct:
!, findProcessor, getType, hasProcessor, print, process, view

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspShSourceCodeFactory class

Description

Package: R.rsp
Class RspShSourceCodeFactory

character
~~|
~~+--RspSourceCodeFactory
~~~~~~~|
~~~~~~~+--RspShSourceCodeFactory

Directly known subclasses:

public class RspShSourceCodeFactory
extends RspSourceCodeFactory

An RspShSourceCodeFactory is an RspSourceCodeFactory for the shell ('sh') script language.

Usage

RspShSourceCodeFactory(...)

Arguments

...

Not used.

Fields and Methods

Methods:

exprToCode -

Methods inherited from RspSourceCodeFactory:
exprToCode, getCompleteCode, getLanguage, makeSourceCode, toSourceCode

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspSourceCode class

Description

Package: R.rsp
Class RspSourceCode

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspProduct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspSourceCode

Directly known subclasses:
RspRSourceCode, RspShSourceCode

public abstract class RspSourceCode
extends RspProduct

An RspSourceCode object is a character vector holding RSP generated source code for a particular programming language.

Usage

RspSourceCode(code=character(), ...)

Arguments

code

character vector.

...

Additional arguments passed to the RspProduct constructor.

Fields and Methods

Methods:

evaluate Evaluates the source code.
print -
rstring -
tangle Drops all text-outputting calls from the source code.
tidy Tidy up the RSP source code.

Methods inherited from RspProduct:
!, findProcessor, getType, hasProcessor, print, process, view

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspSourceCodeFactory class

Description

Package: R.rsp
Class RspSourceCodeFactory

character
~~|
~~+--RspSourceCodeFactory

Directly known subclasses:
RspRSourceCodeFactory, RspShSourceCodeFactory

public abstract class RspSourceCodeFactory
extends character

An RspSourceCodeFactory is language-specific engine that knows how to translate individual RspExpression:s into source code of a specific programming language.

Usage

RspSourceCodeFactory(language=NA, ...)

Arguments

language

A character string.

...

Not used.

Fields and Methods

Methods:

exprToCode Translates an RspExpression into source code.
getCompleteCode Gets the source code header, body, and footer.
getLanguage Gets the language.
makeSourceCode Makes a RspSourceCode object.
toSourceCode Translates an RSP document to source code.

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspString class

Description

Package: R.rsp
Class RspString

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspString

Directly known subclasses:

public class RspString
extends RspObject

An RspString is a character vector with RSP markup.

Usage

RspString(s=character(), ...)

Arguments

s

A character vector.

...

Arguments passed to RspObject.

Fields and Methods

Methods:

evaluate Parses, translates, and evaluates the RSP string.
getSource Gets the source reference of an RSP string.
getType Gets the type of an RSP string.
nbrOfLines Gets the number of lines in an RSP string.
parseDocument Parses an RSP string into a RSP document.
print -
rcat -
rclean -
rcode -
rcompile -
rfile -
rsource -
rstring -
toR Parses and translates the RSP string into R code.

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspStringProduct class

Description

Package: R.rsp
Class RspStringProduct

logical
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspProduct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspStringProduct

Directly known subclasses:

public abstract class RspStringProduct
extends RspProduct

An RspStringProduct is an RspProduct that represents an RSP product in form of a character string.

Usage

RspStringProduct(...)

Arguments

...

character strings passed to RspProduct.

Fields and Methods

Methods:

as.character Returns a plain character string representation of an RSP string product.
print -

Methods inherited from RspProduct:
!, findProcessor, getType, hasProcessor, print, process, view

Methods inherited from RspObject:
print

Methods inherited from logical:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, as.data.frame, as.raster, coerce,ANY,logical-method, whichVector

Author(s)

Henrik Bengtsson


The RspText class

Description

Package: R.rsp
Class RspText

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspText

Directly known subclasses:

public class RspText
extends RspConstruct

An RspText is an RspConstruct that represents a plain text section, i.e. everything that is inbetween any other types of RspConstruct:s. Its content is independent of the underlying programming language.

Usage

RspText(text=character(), escape=FALSE, ...)

Arguments

text

A character string.

escape

If TRUE, character sequences <% and %> are escaped to <%% and %%>.

...

Not used.

Fields and Methods

Methods:

asRspString -
getContent Gets the contents of the RSP text.
getInclude -

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspUnknownDirective class

Description

Package: R.rsp
Class RspUnknownDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspUnknownDirective

Directly known subclasses:

public class RspUnknownDirective
extends RspDirective

An RspUnknownDirective is an RspDirective that is unknown.

Usage

RspUnknownDirective(value="unknown", ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:
No methods defined.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspUnparsedDirective class

Description

Package: R.rsp
Class RspUnparsedDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspUnparsedDirective

Directly known subclasses:

public class RspUnparsedDirective
extends RspDirective

An RspUnparsedDirective is an RspDirective that still has not been parsed for its class and content. After parse():ing such an object, the class of this RSP directive will be known.

Usage

RspUnparsedDirective(value="unparsed", ...)

Arguments

value

A character string.

...

Arguments passed to RspDirective.

Fields and Methods

Methods:

asRspString -
parseDirective Parses the unknown RSP directive for its class.

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspUnparsedExpression class

Description

Package: R.rsp
Class RspUnparsedExpression

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspExpression
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspUnparsedExpression

Directly known subclasses:

public class RspUnparsedExpression
extends RspExpression

An RspUnparsedExpression is an RspExpression that still has not been parsed for its class and content. After parse():ing such an object, the class of this RSP expression will be known.

Usage

RspUnparsedExpression(...)

Arguments

...

Arguments passed to RspExpression.

Fields and Methods

Methods:

parseExpression Parses the unknown RSP expression for its class.

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


The RspVariableDirective class

Description

Package: R.rsp
Class RspVariableDirective

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspDirective
~~~~~~~~~~~~~~~~~|
~~~~~~~~~~~~~~~~~+--RspVariableDirective

Directly known subclasses:
RspIntegerDirective, RspLogicalDirective, RspMetaDirective, RspNumericDirective, RspStringDirective

public class RspVariableDirective
extends RspDirective

An RspVariableDirective is an RspDirective that causes the RSP parser to assign the value of an attribute to an R object of the same name as the attribute at the time of parsing.

Usage

RspVariableDirective(value="variable", ...)

Arguments

value

A character string.

...

Arguments passed to the constructor of RspDirective.

Fields and Methods

Methods:

getInclude -

Methods inherited from RspDirective:
asRspString, getNameContentDefaultAttributes, requireAttributes

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toLatex, uses

Author(s)

Henrik Bengtsson


The RspVoid class

Description

Package: R.rsp
Class RspVoid

character
~~|
~~+--RspObject
~~~~~~~|
~~~~~~~+--RspConstruct
~~~~~~~~~~~~|
~~~~~~~~~~~~+--RspVoid

Directly known subclasses:

public class RspVoid
extends RspConstruct

An RspVoid is an RspConstruct that contains nothing and outputs nothing.

Usage

RspVoid(...)

Arguments

...

Not used.

Fields and Methods

Methods:

asRspString -

Methods inherited from RspConstruct:
asRspString, getComment, getInclude, getSuffixSpecs

Methods inherited from RspObject:
print

Methods inherited from character:
Ops,nonStructure,vector-method, Ops,structure,vector-method, Ops,vector,nonStructure-method, Ops,vector,structure-method, all.equal, as.Date, as.POSIXlt, as.data.frame, as.raster, coerce,ANY,character-method, coerce,character,SuperClassMethod-method, coerce,character,signature-method, coerce<-,ObjectsWithPackage,character-method, coerce<-,signature,character-method, downloadFile, formula, getDLLRegisteredRoutines, glyphJust, isOpen, toAsciiRegExprPattern, toFileListTree, toLatex, uses

Author(s)

Henrik Bengtsson


Subsets an RspDocument

Description

Subsets an RspDocument.

Usage

## S3 method for class 'RspDocument'
x[i]

Arguments

i

Indices of the RSP elements to extract.

Value

Returns an RspDocument.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Returns a short string describing the HTTP daemon

Description

Returns a short string describing the HTTP daemon.

Usage

## S3 method for class 'HttpDaemon'
as.character(x, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Returns a short string describing the HTTP request

Description

Returns a short string describing the HTTP request.

Usage

## S3 method for class 'HttpRequest'
as.character(x, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpRequest.


Returns a plain character string representation of an RSP string product

Description

Returns a plain character string representation of an RSP string product. All attributes including class have been dropped.

Usage

## S3 method for class 'RspStringProduct'
as.character(x, ...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see RspStringProduct.


Recreates an RSP string from an RspConstruct

Description

Recreates an RSP string from an RspConstruct.

Usage

## S3 method for class 'RspConstruct'
asRspString(object, ...)

Arguments

...

Not used.

Value

Returns an RspString.

Author(s)

Henrik Bengtsson

See Also

For more information see RspConstruct.


Starts the internal web browser and opens the URL in the default web browser

Description

Starts the internal web browser and opens the URL in the default web browser. From this page you access not only help pages and demos on how to use RSP, but also other package RSP pages.

Usage

## Default S3 method:
browseRsp(url=paste(urlRoot, path, sep = "/"), urlRoot=sprintf("http://%s:%d",
  host, port), host="127.0.0.1", port=8074L, path="", start=TRUE, stop=FALSE, ...)

Arguments

url

A character string for the URL to be viewed. By default the URL is constructed from the urlRoot and the path parameters.

urlRoot

A character string specifying the URL root. By default the URL is constructed from the host and the port.

host

An optional character string for the host of the URL.

port

An optional integer for the port of the URL.

path

An optional character string for the context path of the URL.

start

If TRUE, the internal R web server is started if not already started, otherwise not.

stop

If TRUE, the internal R web server is stopped, if started.

...

Additional arguments passed to browseURL.

Value

Returns (invisibly) the URL.

Author(s)

Henrik Bengtsson

See Also

Internally, browseURL is used to launch the browser.


Compiles all TeX files into PDFs

Description

Compiles all TeX files into PDFs, unless already done.

Usage

buildNonSweaveTexToPdf(path=".", pattern="[.](tex|ltx)$", ...)

Arguments

path

The directory where to search for TeX files.

pattern

Filename pattern to locate TeX files.

...

Additional arguments passed to texi2pdf.

Value

Returns (invisibly) a named list of results.

Author(s)

Henrik Bengtsson


Builds a non-Sweave Rnw vignette

Description

Builds a non-Sweave Rnw vignette.

Usage

buildNonSweaveVignette(vign, envir=new.env(), ...)

Arguments

...

Not used.

Value

Returns (invisibly) a named list.

Author(s)

Henrik Bengtsson


Builds all non-Sweave Rnw vignette

Description

Builds all non-Sweave Rnw vignette.

Usage

buildNonSweaveVignettes(...)

Arguments

...

Additional arguments passed to buildNonSweaveVignette().

Value

Returns (invisibly) a named list with elements of what the vignette builder returns.

Author(s)

Henrik Bengtsson

See Also

To build vignette, see buildNonSweaveVignette().


Builds a package index HTML file

Description

Builds a package index HTML file, iff missing.

Usage

buildPkgIndexHtml(...)

Arguments

...

Not used.

Value

Returns (invisibly) the absolute pathname to the built index.html file. If an index.html file already exists, nothing is done and NULL is returned.

Author(s)

Henrik Bengtsson


Builds a vignette

Description

Builds a vignette into a PDF or a HTML file.

Usage

buildVignette(file, dir=".", latex=TRUE, tangle=TRUE, quiet=TRUE, clean=TRUE,
  engine=NULL, buildPkg=NULL, ...)

Arguments

file

A character string specifying the vignette source file.

dir

A character string specifying the working directory.

latex

A logical specifying whether a TeX produced by weave should be compiled by texi2pdf or not.

tangle

A logical specifying whether tangle should be run or not.

quiet

A logical specifying whether weave, texi2pdf, and tangle should be run in quiet mode or not.

clean

Remove all files generated by the build, even if there were copies there before.

engine

An optional character string specifying the vignette engine to use for building the vignette. If not specified, it will be inferred from the \VignetteEngine{} markup in the vignette. If that is not specified, the "utils::Sweave" engine will be used.

buildPkg

An optional character string specifying the vignette package to use, if the vignette engine does not specify one.

...

Additional arguments passed to weave and tangle.

Value

Returns the filename to the final vignette (PDF or HTML) product. If latex = FALSE, it may be a TeX file.

Author(s)

Henrik Bengtsson

See Also

Since R devel (to become 3.1.0) r63076 (2013-06-27), there is buildVignette() in the tools package.


Compiles an AsciiDoc file

Description

Compiles an AsciiDoc file.

Usage

## Default S3 method:
compileAsciiDoc(filename, path=NULL, ..., outPath=".", postprocess=TRUE, verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the document to be compiled.

...

Additional arguments passed to executable ascii (which must be on the system search path) called via system2().

outPath

The output and working directory.

postprocess

Should the generated document be post processed or not?

verbose

See Verbose.

Value

Returns the pathname of the generated document.

Author(s)

Henrik Bengtsson


Compiles an AsciiDoc noweb file

Description

Compiles an AsciiDoc noweb file.

Usage

## Default S3 method:
compileAsciiDocNoweb(filename, path=NULL, ..., outPath=".", postprocess=TRUE,
  verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the document to be compiled.

...

Additional arguments passed to Asciidoc() of the ascii package.

outPath

The output and working directory.

verbose

See Verbose.

Value

Returns the pathname of the generated document.

Author(s)

Henrik Bengtsson


Compiles a Knitr file

Description

Compiles a Knitr file.

Usage

## Default S3 method:
compileKnitr(filename, path=NULL, ..., outPath=".", postprocess=TRUE, verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the document to be compiled.

...

Additional arguments passed to compileLaTeX().

outPath

The output and working directory.

postprocess

If TRUE, and a postprocessing method exists for the generated product, it is postprocessed as well.

verbose

See Verbose.

Value

Returns the pathname of the generated document.

Author(s)

Henrik Bengtsson

See Also

Internally, knit is used.


Compiles a LaTeX file

Description

Compiles a LaTeX file to either PDF or DVI.

Usage

## Default S3 method:
compileLaTeX(filename, path=NULL, format=c("pdf", "dvi"), clean=FALSE, quiet=TRUE,
  texinputs=NULL, ..., outPath=".", verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the LaTeX document to be compiled. Only *.tex and *.ltx filename extensions are allowed.

format

A character string specifying the output format.

clean, quiet, texinputs

Additional arguments passed to texi2dvi.

...

Not used.

outPath

The output and working directory.

verbose

See Verbose.

Value

Returns the pathname of the generated (PDF or DVI) document.

Supported filename extensions

Internally texi2dvi is used, which in turn uses Sys.which("texi2dvi") if available. Most known implementation of the latter will only recognize LaTeX documents with filename extensions *.tex and *.ltx (case sensitive). (Any other filenames will be compiled with 'texinfo', which is not a LaTeX compiler.)

Author(s)

Henrik Bengtsson

See Also

Internally, texi2dvi is used. To compile Sweave LaTeX documents, compileSweave().


Compiles a Markdown file

Description

Compiles a Markdown file to HTML.

Usage

## Default S3 method:
compileMarkdown(filename, path=NULL, ..., outPath=".", header=NULL,
  metadata=getMetadata(filename), verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the Markdown document to be compiled.

...

Additional arguments passed to markdownToHTML.

outPath

The output and working directory.

header

character vector of valid HTML strings that should be added to the HTML <head> section.

metadata

A named list with meta data that will add as <meta> tags in the HTML <head> section.

verbose

See Verbose.

Details

The input encoding is based on getOption("encoding") and the output encoding is "UTF-8" (forced by markdownToHTML).

Value

Returns the pathname of the generated HTML document.

Author(s)

Henrik Bengtsson

See Also

Internally, markdownToHTML is used.


Compiles a Rnw file

Description

Compiles a Rnw file. The compiler used depends on the content type.

Usage

## Default S3 method:
compileRnw(filename, path=NULL, ..., type=NULL, verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the document to be compiled.

...

Additional arguments passed to the compiler function used.

type

A character string specifying what content type of Rnw file to compile. The default (NULL) is to infer the type from the content of the file using typeOfRnw().

verbose

See Verbose.

Value

Returns the pathname of the generated document.

Author(s)

Henrik Bengtsson


Compiles an RSP file

Description

Compiles an RSP file.

Usage

## Default S3 method:
compileRsp(filename, path=NULL, ..., outPath=".", envir=parent.frame(), verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the RSP document to be compiled.

...

Additional arguments passed to rfile.

outPath

The output and working directory.

verbose

See Verbose.

Value

Returns the pathname of the generated document.

Author(s)

Henrik Bengtsson


Compiles a Sweave file

Description

Compiles a Sweave file.

Usage

## Default S3 method:
compileSweave(filename, path=NULL, ..., outPath=".", postprocess=TRUE, verbose=FALSE)

Arguments

filename, path

The filename and (optional) path of the Sweave document to be compiled.

...

Additional arguments passed to compileLaTeX().

outPath

The output and working directory.

postprocess

If TRUE, and a postprocessing method exists for the generated product, it is postprocessed as well.

verbose

See Verbose.

Value

Returns the pathname of the generated document.

Author(s)

Henrik Bengtsson

See Also

Internally, Sweave is used.


Drops all empty RSP text constructs

Description

Drops all empty RSP text constructs.

Usage

## S3 method for class 'RspDocument'
dropEmptyText(object, ..., verbose=FALSE)

Arguments

...

Not used.

verbose

See Verbose.

Value

Returns an RspDocument.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Escapes a string specifically for a given RSP response language

Description

Escapes a string specifically for a given RSP response language.

Usage

## S3 method for class 'RspLanguage'
escape(this, ...)

Arguments

...

R objects to be pasted together.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspLanguage.


Parses, translates, and evaluates the RSP document

Description

Parses, translates, and evaluates the RSP document.

Usage

## S3 method for class 'RspDocument'
evaluate(object, envir=parent.frame(), ...)

Arguments

envir

The environment where the RSP document is evaluated.

...

Not used.

Value

Returns the last evaluated expression, iff any.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Parses and evaluates the R code

Description

Parses and evaluates the R code.

Usage

## S3 method for class 'RspRSourceCode'
evaluate(object, envir=parent.frame(), args="*", output=c("RspStringProduct", "stdout"),
  ..., verbose=FALSE)

Arguments

envir

The environment in which the RSP string is evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

output

A character string specifying how the RSP output should be handled/returned.

...

Not used.

Value

If output="stdout", then NULL is returned and the RSP output is sent to the standard output. This is output is "non-buffered", meaning it will be sent to the output as soon as it is generated. If output="RspStringProduct", then the output is captured and returned as an RspStringProduct with attributes set.

Author(s)

Henrik Bengtsson

See Also

For more information see RspRSourceCode.


Evaluates the shell (sh) code

Description

Evaluates the shell (sh) code.

Usage

## S3 method for class 'RspShSourceCode'
evaluate(object, envir=parent.frame(), args="*", output=c("RspStringProduct", "stdout"),
  ..., verbose=FALSE)

Arguments

envir

The environment in which the RSP string is evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

output

A character string specifying how the RSP output should be handled/returned.

...

Optional arguments passed to eval().

Value

If output="stdout", then NULL is returned and the RSP output is sent to the standard output. Note that this is output is "buffered", meaning it will be sent to standard output upon completion. This is a limitation of R. If output="RspStringProduct", then the output is captured and returned as an RspStringProduct with attributes set.

Author(s)

Henrik Bengtsson

See Also

For more information see RspShSourceCode.


Evaluates the source code

Description

Evaluates the source code.

Usage

## S3 method for class 'RspSourceCode'
evaluate(...)

Arguments

...

Not used.

Value

Returns the last evaluated expression, iff any.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCode.


Parses, translates, and evaluates the RSP string

Description

Parses, translates, and evaluates the RSP string.

Usage

## S3 method for class 'RspString'
evaluate(object, envir=parent.frame(), ...)

Arguments

envir

The environment where the RSP string is evaluated.

...

Not used.

Value

Returns the last evaluated expression, iff any.

Author(s)

Henrik Bengtsson

See Also

For more information see RspString.


Translates an RspExpression into source code

Description

Translates an RspExpression into source code.

Usage

## S3 method for class 'RspSourceCodeFactory'
exprToCode(...)

Arguments

...

Not used.

Value

Returns a character vector.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCodeFactory.


Locates the asciidoc executable

Description

Locates the asciidoc executable on the current system.

Usage

## Default S3 method:
findAsciiDoc(mustExist=TRUE, ..., verbose=FALSE)

Arguments

mustExist

If TRUE, an exception is thrown if the executable could not be located.

...

Not used.

verbose

See Verbose.

Details

The 'asciidoc' executable is searched for as follows:

  1. Sys.which("asciidoc")

Value

Returns the pathname to the executable, or NULL if not found.

Author(s)

Henrik Bengtsson


Locates the pandoc executable

Description

Locates the pandoc executable on the current system.

Usage

## Default S3 method:
findPandoc(mustExist=TRUE, ..., verbose=FALSE)

Arguments

mustExist

If TRUE, an exception is thrown if the executable could not be located.

...

Not used.

verbose

See Verbose.

Details

The executable is searched for as follows:

  1. Sys.which("pandoc")

Value

Returns the pathname to the executable, or NULL if not found.

Author(s)

Henrik Bengtsson


Locates a processor for an RSP product

Description

Locates a processor for an RSP product.

Usage

## S3 method for class 'RspProduct'
findProcessor(object, ...)

Arguments

...

Not used.

Value

Returns a function that takes an RspProduct as input, or NULL if no processor was found.

Author(s)

Henrik Bengtsson


Flattens an RspDocument

Description

Flattens an RspDocument by expanding and inserting the list of RspConstructs for any RspDocument.

Usage

## S3 method for class 'RspDocument'
flatten(object, ..., verbose=FALSE)

Arguments

...

Not used.

verbose

See Verbose.

Value

Returns an RspDocument that contains only RspConstruct:s (and no RspDocument).

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Flushes the response buffer

Description

Flushes the response buffer.

Usage

## S3 method for class 'RspResponse'
flush(...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see RspResponse.


Gets the absolute pathname to the current RSP file

Description

Gets the absolute pathname to the current RSP file.

Usage

## S3 method for class 'FileRspResponse'
getAbsolutePath(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see FileRspResponse.


Gets the absolute pathname to the current RSP file

Description

Gets the absolute pathname to the current RSP file.

Usage

## S3 method for class 'RspPage'
getAbsolutePath(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspPage.


Gets and sets attributes of an object

Description

Gets and sets attributes of an object.

Usage

## Default S3 method:
getAttributes(object, private=FALSE, ...)

Arguments

object

An object.

private

If TRUE, attributes starting with a period are also returned, otherwise not.

...

Not used.

Value

Returns a named list, NULL or a modified object itself.

Author(s)

Henrik Bengtsson


Gets the source code

Description

Gets the source code.

Usage

## S3 method for class 'RspCode'
getCode(code, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspCode.


Gets the comment

Description

Gets the comment.

Usage

## S3 method for class 'RspComment'
getComment(comment, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspComment.


Gets the comment of an RSP construct

Description

Gets the comment of an RSP construct.

Usage

## S3 method for class 'RspConstruct'
getComment(object, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspConstruct.


Gets a comment string specific for a given RSP response language

Description

Gets a comment string specific for a given RSP response language.

Usage

## S3 method for class 'RspLanguage'
getComment(this, ...)

Arguments

...

R objects to be pasted together.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspLanguage.


Gets the source code header, body, and footer

Description

Gets the source code header, body, and footer.

Usage

## S3 method for class 'RspSourceCodeFactory'
getCompleteCode(this, object, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCodeFactory.


Gets the content of the RSP eval directive

Description

Gets the content of the RSP eval directive.

Usage

## S3 method for class 'RspEvalDirective'
getContent(directive, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspEvalDirective.


Gets the content of the RSP include directive

Description

Gets the content of the RSP include directive.

Usage

## S3 method for class 'RspIncludeDirective'
getContent(directive, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspIncludeDirective.


Gets the contents of the RSP text

Description

Gets the contents of the RSP text.

Usage

## S3 method for class 'RspText'
getContent(text, unescape=FALSE, ...)

Arguments

unescape

If TRUE, character sequences <%% and %%> are unescaped to <% and %>.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspText.


Gets the length of contents

Description

Gets the length of contents (in bytes), or -1 if the length is not known.

Usage

## S3 method for class 'HttpRequest'
getContentLength(this, ...)

Arguments

...

Not used.

Value

Returns an integer.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpRequest.


Gets the MIME type of the body of the request

Description

Gets the MIME type of the body of the request, or NULL if the type is not known.

Usage

## S3 method for class 'HttpRequest'
getContentType(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpRequest.


Checks whether the source code should be echoed or not

Description

Checks whether the source code should be echoed or not.

Usage

## S3 method for class 'RspCode'
getEcho(code, ...)

Arguments

...

Not used.

Value

Returns a logical.

Author(s)

Henrik Bengtsson

See Also

For more information see RspCode.


Gets the file attribute

Description

Gets the file attribute.

Usage

## S3 method for class 'RspEvalDirective'
getFile(directive, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspEvalDirective.


Gets the file attribute

Description

Gets the file attribute.

Usage

## S3 method for class 'RspIncludeDirective'
getFile(directive, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspIncludeDirective.


Checks whether an RSP construct will include text to the output or not

Description

Checks whether an RSP construct will include text to the output or not.

Usage

## S3 method for class 'RspConstruct'
getInclude(object, ...)

Arguments

...

Not used.

Value

Returns TRUE of FALSE.

Author(s)

Henrik Bengtsson

See Also

For more information see RspConstruct.


Gets the language string

Description

Gets the language string.

Usage

## S3 method for class 'RspLanguage'
getLanguage(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspLanguage.


Gets the language

Description

Gets the language.

Usage

## S3 method for class 'RspSourceCodeFactory'
getLanguage(this, ...)

Arguments

...

Not used.

Value

Returns an character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCodeFactory.


Gets the (base)name of the current RSP file

Description

Gets the (base)name of the current RSP file.

Usage

## S3 method for class 'FileRspResponse'
getName(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see FileRspResponse.


Gets the (base)name of the current RSP file

Description

Gets the (base)name of the current RSP file.

Usage

## S3 method for class 'RspPage'
getName(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspPage.


Gets the newline string specific for a given RSP response language

Description

Gets the newline string specific for a given RSP response language.

Usage

## S3 method for class 'RspLanguage'
getNewline(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspLanguage.


Gets the output for an RSP response

Description

Gets the output for an RSP response.

Usage

## S3 method for class 'FileRspResponse'
getOutput(this, ...)

Arguments

...

Not used.

Value

Returns a connection or a filename.

Author(s)

Henrik Bengtsson

See Also

For more information see FileRspResponse.


Gets a parameter

Description

Gets a parameter.

Usage

## S3 method for class 'HttpRequest'
getParameter(this, name, default=NULL, drop=TRUE, ...)

Arguments

name

Name of parameter to be retrieved.

default

Value to be returned if parameter is missing.

drop

If TRUE and the number of returned values is one, then this single value is returned, otherwise a named vector.

...

Additional arguments passed to *getParameters().

Value

Returns the value(s) of the parameter either as a single value or as a named list. If the parameter does not exist, the default value is returned as is.

Author(s)

Henrik Bengtsson

See Also

*hasParameter(). *getParameters(). For more information see HttpRequest.


Gets all parameters

Description

Gets all parameters.

Usage

## S3 method for class 'HttpRequest'
getParameters(this, trim=FALSE, ...)

Arguments

trim

If TRUE, each parameter value is trimmed of whitespace.

...

Not used.

Value

Returns a named list.

Author(s)

Henrik Bengtsson

See Also

*getParameter(). For more information see HttpRequest.


Gets the path of the directory of the current RSP file

Description

Gets the path of the directory of the current RSP file.

Usage

## S3 method for class 'FileRspResponse'
getPath(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see FileRspResponse.


Gets the path to the source reference of an RSP string

Description

Gets the path to the source reference of an RSP string.

Usage

## S3 method for class 'RspDocument'
getPath(object, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Gets the path of the directory of the current RSP file

Description

Gets the path of the directory of the current RSP file.

Usage

## S3 method for class 'RspPage'
getPath(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspPage.


Gets the name and version of the protocol used to make this request

Description

Gets the name and version of the protocol used to make this request, e.g. HTTP/1.1.

Usage

## S3 method for class 'HttpRequest'
getProtocol(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

getScheme(). For more information see HttpRequest.


Gets the file system path for a given URI

Description

Gets the file system path for a given URI.

Usage

## S3 method for class 'HttpRequest'
getRealPath(this, uri, ...)

Arguments

uri

A URI as a character string.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpRequest.


Gets the IP address of the client that sent the request

Description

Gets the IP address of the client that sent the request.

Usage

## S3 method for class 'HttpRequest'
getRemoteAddress(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

getRemoteHost(). For more information see HttpRequest.


Gets the fully qualified name of the client that sent the request

Description

Gets the fully qualified name of the client that sent the request. If it cannot resolve the hostname, this method returns the dotted-string form of the IP address.

Usage

## S3 method for class 'HttpRequest'
getRemoteHost(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

getRemoteAddress(). For more information see HttpRequest.


Gets the scheme used to make this request

Description

Gets the scheme used to make this request, e.g. http, https, or ftp.

Usage

## S3 method for class 'HttpRequest'
getScheme(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

getProtocol(). For more information see HttpRequest.


Gets the host name of the server that reviewed the request

Description

Gets the host name of the server that reviewed the request.

Usage

## S3 method for class 'HttpRequest'
getServerName(this, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

getServerPort(). For more information see HttpRequest.


Gets the port number on which this request was received

Description

Gets the port number on which this request was received.

Usage

## S3 method for class 'HttpRequest'
getServerPort(this, ...)

Arguments

...

Not used.

Value

Returns an integer.

Author(s)

Henrik Bengtsson

See Also

getServerPort(). For more information see HttpRequest.


Gets the source reference of an RSP document

Description

Gets the source reference of an RSP document.

Usage

## S3 method for class 'RspDocument'
getSource(object, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Gets the source reference of an RSP string

Description

Gets the source reference of an RSP string.

Usage

## S3 method for class 'RspString'
getSource(object, ...)

Arguments

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspString.


Gets the suffix specifications

Description

Gets the suffix specifications.

Usage

## S3 method for class 'RspConstruct'
getSuffixSpecs(object, ...)

Arguments

...

Not used.

Value

Returns a trimmed character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspConstruct.


Gets the type of the RspDocument

Description

Gets the type of the RspDocument.

Usage

## S3 method for class 'RspDocument'
getType(object, default=NA, as=c("text", "IMT"), ...)

Arguments

default

If unknown/not set, the default content type to return.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Gets the content type

Description

Gets the content type.

Usage

## S3 method for class 'RspPageDirective'
getType(directive, default=NA, as=c("text", "IMT"), ...)

Arguments

default

If unknown/not set, the default content type to return.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspPageDirective.


Gets the type of an RSP product

Description

Gets the type of an RSP product.

Usage

## S3 method for class 'RspProduct'
getType(object, default=NA_character_, as=c("text", "IMT"), ...)

Arguments

default

If unknown/not set, the default content type to return.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspProduct.


Gets the type of an RSP string

Description

Gets the type of an RSP string.

Usage

## S3 method for class 'RspString'
getType(object, default=NA, as=c("text", "IMT"), ...)

Arguments

default

If unknown/not set, the default content type to return.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspString.


Checks if verbatim include should be used or not

Description

Checks if verbatim include should be used or not.

Usage

## S3 method for class 'RspIncludeDirective'
getVerbatim(directive, ...)

Arguments

...

Not used.

Value

Returns a logical.

Author(s)

Henrik Bengtsson

See Also

For more information see RspIncludeDirective.


Gets a verbatim string specific for a given RSP response language

Description

Gets a verbatim string specific for a given RSP response language.

Usage

## S3 method for class 'RspLanguage'
getVerbatim(this, ...)

Arguments

...

R objects to be pasted together.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

For more information see RspLanguage.


Get the wrap length

Description

Get the wrap length.

Usage

## S3 method for class 'RspIncludeDirective'
getWrap(directive, ...)

Arguments

...

Not used.

Value

Returns an integer, or NULL.

Author(s)

Henrik Bengtsson

See Also

For more information see RspIncludeDirective.


Checks if a parameter exists

Description

Checks if a parameter exists.

Usage

## S3 method for class 'HttpRequest'
hasParameter(this, name, ...)

Arguments

name

Name of parameter to be checked.

...

Not used.

Value

Returns TRUE if the parameter exists, otherwise FALSE.

Author(s)

Henrik Bengtsson

See Also

*getParameter(). For more information see HttpRequest.


Checks whether a processor exist or not for an RSP product

Description

Checks whether a processor exist or not for an RSP product.

Usage

## S3 method for class 'RspProduct'
hasProcessor(object, ...)

Arguments

...

Not used.

Value

Returns TRUE if one exists, otherwise FALSE.

Author(s)

Henrik Bengtsson


Gets the first index of a string that is not inside a double quoted string

Description

Gets the first index of a string that is not inside a double quoted string.

Usage

## Default S3 method:
indexOfNonQuoted(str, pattern, ...)

Arguments

str

The character string to be scanned.

pattern

The character string to be searched for.

...

Not used.

Value

Returns an integer giving the position of (the first character of) the search string in the main string. If not found, -1 is returned.

Author(s)

Henrik Bengtsson

See Also

grep().


Makes a RspSourceCode object

Description

Makes a RspSourceCode object.

Usage

## S3 method for class 'RspSourceCodeFactory'
makeSourceCode(this, code, ...)

Arguments

code

A character vector of code strings.

...

Arguments passed to the language-specific RspSourceCode constructor, e.g. type and metadata.

Value

Returns a RspSourceCode object.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCodeFactory.


Merge neighboring 'text' elements

Description

Merge neighboring 'text' elements by pasting them together.

Usage

## S3 method for class 'RspDocument'
mergeTexts(object, trim=FALSE, ..., verbose=FALSE)

Arguments

...

Not used.

Value

Returns an RspDocument with equal or fever number of elements.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Gets the number of lines in an RSP string

Description

Gets the number of lines in an RSP string.

Usage

## S3 method for class 'RspString'
nbrOfLines(object, ...)

Arguments

...

Not used.

Value

Returns a non-negative integer.

Author(s)

Henrik Bengtsson

See Also

For more information see RspString.


Gets the number of parameters

Description

Gets the number of parameters.

Usage

## S3 method for class 'HttpRequest'
nbrOfParameters(this, ...)

Arguments

...

Not used.

Value

Returns an integer.

Author(s)

Henrik Bengtsson

See Also

*getParameter(). *hasParameter(). For more information see HttpRequest.


Starts the HTTP daemon and launches the specified URL

Description

Starts the HTTP daemon and launches the specified URL.

Usage

## S3 method for class 'HttpDaemon'
openUrl(static, url=sprintf("http://%s:%d/%s", host, port, path), host="127.0.0.1",
  port=8074, path="", ...)

Arguments

url

The URL to be opened.

host

The host where the HTTP server is running.

port

The port to be used.

path

The path to the document to be opened.

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

Called by for instance *startHelp(). For more information see HttpDaemon.


Parses the R code

Description

Parses the R code.

Usage

## S3 method for class 'RspRSourceCode'
parseCode(object, ...)

Arguments

...

Not used.

Value

Returns an expression.

Author(s)

Henrik Bengtsson

See Also

For more information see RspRSourceCode.


Parses the unknown RSP directive for its class

Description

Parses the unknown RSP directive for its class.

Usage

## S3 method for class 'RspUnparsedDirective'
parseDirective(expr, ...)

Arguments

...

Not used.

Value

Returns an RspDirective of known class.

Author(s)

Henrik Bengtsson

See Also

For more information see RspUnparsedDirective.


Parse an RSP string into and RSP document

Description

Parse an RSP string into and RSP document with RSP comments dropped.

Usage

## S3 method for class 'RspParser'
parseDocument(parser, object, envir=parent.frame(), ...,
  until=c("*", "end", "expressions", "directives", "comments"),
  as=c("RspDocument", "RspString"), verbose=FALSE)

Arguments

object

An RspString to be parsed.

envir

The environment where the RSP document is preprocessed.

...

Passed to the processor in each step.

until

Specifies how far the parse should proceed, which is useful for troubleshooting and debugging.

as

Specifies in what format the parsed RSP document should be returned.

verbose

See Verbose.

Value

Returns a RspDocument (when as = "RspDocument"; default) or RspString (when as = "RspString").

Author(s)

Henrik Bengtsson

See Also

For more information see RspParser.


Parses an RSP string into a RSP document

Description

Parses an RSP string into a RSP document.

Usage

## S3 method for class 'RspString'
parseDocument(object, ..., envir=parent.frame(), parser=RspParser())

Arguments

...

Additional arguments passed to the RSP parser.

envir

The environment where the RSP document is parsed.

parser

An RspParser.

Value

Returns a RspDocument (unless until != "*" in case it returns a deparsed RspString.)

Author(s)

Henrik Bengtsson

See Also

For more information see RspString.


Parses the unknown RSP expression for its class

Description

Parses the unknown RSP expression for its class.

Usage

## S3 method for class 'RspUnparsedExpression'
parseExpression(expr, ...)

Arguments

...

Not used.

Value

Returns an RspExpression of known class.

Author(s)

Henrik Bengtsson

See Also

For more information see RspUnparsedExpression.


Parses the string into blocks of text and RSP

Description

Parses the string into blocks of text and RSP.

Usage

## S3 method for class 'RspParser'
parseRaw(parser, object, what=c("comment", "directive", "expression"), commentLength=-1L,
  ..., verbose=FALSE)

Arguments

object

An RspString to be parsed.

what

A character string specifying what type of RSP construct to parse for.

commentLength

Specify the number of hyphens in RSP comments to parse for.

...

Not used.

verbose

See Verbose.

Value

Returns a named list with elements named "text" and "rsp".

Author(s)

Henrik Bengtsson

See Also

For more information see RspParser.


Parses an Rnw file

Description

Parses an Rnw file.

Usage

parseVignette(pathname, commentPrefix="^[ \t]*%[ \t]*", final=FALSE, source=FALSE,
  maxLines=-1L, ...)

Arguments

pathname

The Rnw file to be parsed.

commentPrefix

A regular expression specifying the prefix pattern of vignette comments.

final

If TRUE, the output PDF or HTML file is also located.

source

If TRUE, the output R source code file is also located.

maxLines

The maximum number of lines to scan.

...

Not used.

Value

Returns a named list or NULL if a non-vignette.

Author(s)

Henrik Bengtsson


Locates and parses all vignettes

Description

Locates and parses all vignettes.

Usage

parseVignettes(path=".", pattern="[.][^.~]*$", ..., drop="^dummy.tex$")

Arguments

path

The directory where to search for vignettes.

pattern

Filename pattern to locate vignettes.

...

Additional arguments passed to parseVignette().

drop

A vector of filename patterns of vignette sources to be ignored.

Value

Returns a list where each element corresponds to an identified vignette source file. A file is considered to be a vignette source file if it has \Vignette.*{} markups in the top 50 lines. Each such vignette element consists of a named list with the parse \Vignette.*{} information.

Author(s)

Henrik Bengtsson


Processes all RSP preprocessing directives

Description

Processes all RSP preprocessing directives.

Usage

## S3 method for class 'RspDocument'
preprocess(object, recursive=TRUE, flatten=TRUE, envir=parent.frame(),
  clipboard=new.env(), ..., verbose=FALSE)

Arguments

recursive

If TRUE, any RspDocuments introduced via preprocessing directives are recursively parsed and preprocessed as well.

flatten

If TRUE, any RspDocument introduced is replaced (inserted and expanded) by its list of RspConstructs.

envir

The environment where the preprocessing is evaluated.

clipboard

An environment hold cut'n'paste directives during preprocessing.

...

Not used.

verbose

See Verbose.

Value

Returns an RspDocument.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Prints RSP arguments

Description

Prints RSP arguments returned by rargs().

Usage

## S3 method for class 'RspArguments'
print(x, ...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

rargs().


Prints a summary of an RSP object

Description

Prints a summary of an RSP object.

Usage

## S3 method for class 'RspObject'
print(x, ...)

Arguments

...

Not used.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see RspObject.


Processes an RSP file product

Description

Processes an RSP file product.

Usage

## S3 method for class 'RspProduct'
process(object, type=NULL, envir=parent.frame(), workdir=NULL, ..., recursive=TRUE,
  verbose=FALSE)

Arguments

type

A character string specifying the content type.

workdir

A temporary working directory to use during processing. If NULL, the working directory is not changed.

...

Optional arguments passed to the processor function.

recursive

If a positive number (or +Inf), then processed output that can be processed will be processed recursively (with this argument being decreased by one). A value TRUE corresponds to +Inf (infinite processing if possible). A value FALSE corresponds to 0 (no further processing).

verbose

See Verbose.

Value

Returns the processed RSP product output as another RspProduct. If no processor exists, the input object itself is returned.

Author(s)

Henrik Bengtsson


Gets RSP arguments of an RSP document

Description

Gets RSP arguments of an RSP document, if any.

Usage

## Default S3 method:
rargs(...)

Arguments

...

Arguments passed to rcompile().

Details

Any RSP preprocessing variable with an 'description' attribute is considered to be an RSP argument.

Value

Returns a data.frame of class 'RspArguments'.

Author(s)

Henrik Bengtsson

See Also

rfile().

Examples

path <- system.file("rsp_examples", package="R.rsp")
args <- rargs(file="LoremIpsum.tex.rsp", path=path)
print(args)



Evaluates an RSP string and outputs the generated string

Description

Evaluates an RSP string and outputs the generated string.

Usage

 ## Default S3 method:
rcat(..., file=NULL, path=NULL, envir=parent.frame(), args="*", output="", buffered=TRUE,
  append=FALSE, verbose=FALSE)
 ## Default S3 method:
rsource(file, path=NULL, envir=parent.frame(), output="", buffered=FALSE, ...)

Arguments

...

A character string with RSP markup.

file, path

Alternatively, a file, a URL or a connection from with the strings are read. If a file, the path is prepended to the file, iff given.

envir

The environment in which the RSP string is preprocessed and evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

output

A connection, or a pathname where to direct the output. If "", the output is sent to the standard output.

buffered

If TRUE, and output="", then the RSP output is outputted as soon as possible, if possible.

append

Only applied if output specifies a pathname. If TRUE, then the output is appended to the file, otherwise the files content is overwritten.

verbose

See Verbose.

Value

Returns (invisibly) the outputted RspStringProduct.

Processing RSP strings from the command line

Using Rscript and rcat(), it is possible to process an RSP string and output the result from the command line. For example,

Rscript -e "R.rsp::rcat('A random integer in [1,<%=K%>]: <%=sample(1:K, size=1)%>')" --args --K=50

parses and evaluates the RSP string and outputs the result to standard output. A CLI-friendly alternative to the above is:

Rscript -e R.rsp::rcat "A random integer in [1,<%=K%>]: <%=sample(1:K, size=1)%>" --args --K=50

rsource()

The rsource(file, ...) is a convenient wrapper for rcat(file=file, ..., output="", buffered=FALSE). As an analogue, rsource() is to an RSP file what source() is to an R script file.

Author(s)

Henrik Bengtsson

See Also

To store the output in a string (instead of displaying it), see rstring(). For evaluating and postprocessing an RSP document and writing the output to a file, see rfile().

Examples

rcat("A random integer in [1,100]: <%=sample(1:100, size=1)%>\n")

# Passing arguments
rcat("A random integer in [1,<%=K%>]: <%=sample(1:K, size=1)%>\n", args=list(K=50))



Compiles an RSP document into a preprocessed and validated RSP document

Description

Compiles an RSP document into a preprocessed and validated RSP document.

Usage

## Default S3 method:
rclean(..., file=NULL, path=NULL, envir=parent.frame(), args="*", verbose=FALSE)

Arguments

...

character strings with RSP markup.

file, path

Alternatively, a file, a URL or a connection from with the strings are read. If a file, the path is prepended to the file, iff given.

envir

The environment in which the RSP string is preprocessed.

args

A named list of arguments assigned to the environment in which the RSP document is parsed. See cmdArgs.

verbose

See Verbose.

Value

Returns an RspString.

Author(s)

Henrik Bengtsson

See Also

rcat() and rfile().

Examples

# RSP-embedded text to a preprocessed and validated RSP string
s <- rclean('Current <%@include content="time"%> is <%=Sys.time()%>\n')
print(s)

Compiles an RSP document and returns the generated source code script

Description

Compiles an RSP document and returns the generated source code script.

Usage

## Default S3 method:
rcode(..., file=NULL, path=NULL, output=NULL, workdir=NULL, envir=parent.frame(),
  args="*", verbose=FALSE)

Arguments

...

character strings with RSP markup.

file, path

Alternatively, a file, a URL or a connection from with the strings are read. If a file, the path is prepended to the file, iff given.

output

A character string or a connection specifying where output should be directed. The default is a file with a filename where the file extension(s) (typically ".*.rsp") has been replaced by ".R" in the directory given by the workdir argument.

workdir

The working directory to use after parsing and preprocessing. If argument output specifies an absolute pathname, then the directory of output is used, otherwise the current directory is used.

envir

The environment in which the RSP string is preprocessed and evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

verbose

See Verbose.

Value

Returns an RspFileProduct if possible, otherwise an RspSourceCode.

Author(s)

Henrik Bengtsson

See Also

rcat() and rfile().

Examples

# RSP-embedded text to an R script
code <- rcode("Current time is <%=Sys.time()%>\n")
cat(code, sep="\n")

# RSP-embedded text to a shell script
code <- rcode("Current time is <%=date%>\n", language="sh")
cat(code, sep="\n")

Compiles an RSP document

Description

Compiles an RSP document.

Usage

## Default S3 method:
rcompile(..., file=NULL, path=NULL, output=NULL, workdir=NULL, envir=parent.frame(),
  args="*", until="*", verbose=FALSE)

Arguments

...

character strings with RSP markup.

file, path

Alternatively, a file, a URL or a connection from with the strings are read. If a file, the path is prepended to the file, iff given.

output

A character string or a connection specifying where output should be directed. The default is a file with a filename where the input filename has been prepended by compiled- and saved in the directory given by the workdir argument.

workdir

The working directory to use after parsing and preprocessing. If argument output specifies an absolute pathname, then the directory of output is used, otherwise the current directory is used.

envir

The environment in which the RSP string is preprocessed and evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

until

Specifies how far the compilation should proceed.

verbose

See Verbose.

Value

Returns an RspString, RspDocument or an RspFileProduct (depending on argument output).

Author(s)

Henrik Bengtsson

See Also

rcat() and rfile().


Asserts that certain attributes exist

Description

Asserts that certain attributes exist.

Usage

## S3 method for class 'RspDirective'
requireAttributes(this, names, condition=c("all", "any"), ...)

Arguments

condition

A character specifying the condition to be tested.

...

Not used.

Value

Returns itself (invisibly).

Author(s)

Henrik Bengtsson

See Also

For more information see RspDirective.


Evaluates and postprocesses an RSP document and outputs the final RSP document file

Description

Evaluates and postprocesses an RSP document and outputs the final RSP document file.

Usage

## Default S3 method:
rfile(file, path=NULL, output=NULL, workdir=NULL, type=NA, envir=parent.frame(),
  args="*", postprocess=TRUE, ..., verbose=FALSE)

Arguments

file, path

Specifies the RSP file to processed, which can be a file, a URL or a connection. If a file, the path is prepended to the file, iff given.

output

A character string or a connection specifying where output should be directed. The default is a file with a filename where the file extension (typically ".rsp") has been dropped from file in the directory given by the workdir argument.

workdir

The working directory to use after parsing and preprocessing, but while evaluating and postprocessing the RSP document. If argument output specifies an absolute pathname, then the directory of output is used, otherwise the current directory is used.

type

The default content type of the RSP document. By default, it is inferred from the output filename extension, iff possible.

envir

The environment in which the RSP document is preprocessed and evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

postprocess

If TRUE, and a postprocessing method exists for the generated RSP product, it is postprocessed as well.

...

Additional arguments passed to the RSP engine.

verbose

See Verbose.

Value

Returns an RspProduct. If argument output specifies a file, then this is an RspFileProduct.

Processing RSP files from the command line

Using Rscript and rfile(), it is possible to process an RSP file from the command line. For example,

Rscript -e "R.rsp::rfile('RSP_refcard.tex.rsp')"

parses and evaluates ‘RSP_refcard.tex.rsp’ and output ‘RSP_refcard.pdf’ in the current directory. A CLI-friendly alternative to the above is:

Rscript -e R.rsp::rfile RSP_refcard.tex.rsp

Author(s)

Henrik Bengtsson

See Also

rstring() and rcat().

Examples

path <- system.file("exData", package="R.rsp")
pathname <- rfile("random.txt.rsp", path=path,
                  output=file.path(tempdir(), "random.txt"))
print(pathname)

lines <- readLines(pathname, warn=FALSE)
cat(lines, collapse="\n")

file.remove(pathname)


# Passing arguments
path <- system.file("exData", package="R.rsp")
pathname <- rfile("random-args.txt.rsp", path=path, args=list(K=50),
                  output=file.path(tempdir(), "random-args.txt"))
print(pathname)

lines <- readLines(pathname, warn=FALSE)
cat(lines, collapse="\n")

file.remove(pathname)


## Not run: 
# Compile and display the main vignette (requires LaTeX)
if (isCapableOf(R.rsp, "latex")) {
  path <- system.file("doc", package="R.rsp")
  pdf <- rfile("Dynamic_document_creation_using_RSP.tex.rsp", path=path)
  cat("Created document: ", pdf, "\n", sep="")
  if (interactive()) browseURL(pdf)
}

## End(Not run)

A tangle function for RSP documents

Description

A tangle function for RSP documents. This function is for RSP what Stangle is for Sweave documents.

Usage

rspTangle(file, ..., envir=new.env(), pattern="(|[.][^.]*)[.]rsp$")

Arguments

file

The file to be tangled.

...

Not used.

envir

The environment where the RSP document is parsed.

pattern

A filename pattern used to identify the name.

Value

Returns the absolute pathname of the generated R source code file.

Author(s)

Henrik Bengtsson

See Also

rspWeave()


A weave function for RSP documents

Description

A weave function for RSP documents. This function is for RSP what Sweave is for Sweave documents.

Usage

rspWeave(file, ..., postprocess=TRUE, clean=TRUE, quiet=FALSE, envir=new.env(),
  .engineName="rsp")

Arguments

file

The file to be weaved.

...

Not used.

postprocess

If TRUE, the compiled document is also post processed, if possible.

clean

If TRUE, intermediate files are removed, otherwise not.

quiet

If TRUE, no verbose output is generated.

envir

The environment where the RSP document is parsed and evaluated.

.engineName

Internal only.

Value

Returns the absolute pathname of the generated RSP product. The generated RSP product is postprocessed, if possible.

Author(s)

Henrik Bengtsson

See Also

rspTangle()


Evaluates an RSP string and returns the generated string

Description

Evaluates an RSP string and returns the generated string.

Usage

## Default S3 method:
rstring(..., file=NULL, path=NULL, envir=parent.frame(), args="*", verbose=FALSE)

Arguments

...

A character string with RSP markup.

file, path

Alternatively, a file, a URL or a connection from with the strings are read. If a file, the path is prepended to the file, iff given.

envir

The environment in which the RSP string is preprocessed and evaluated.

args

A named list of arguments assigned to the environment in which the RSP string is parsed and evaluated. See cmdArgs.

verbose

See Verbose.

Value

Returns an RspStringProduct.

Author(s)

Henrik Bengtsson

See Also

To display the output (instead of returning a string), see rcat(). For evaluating and postprocessing an RSP document and writing the output to a file, see rfile().

Examples

x <- rstring("A random integer in [1,100]: <%=sample(1:100, size=1)%>\n")
cat(x)

# Passing arguments
x <- rstring("A random integer in [1,<%=K%>]: <%=sample(1:K, size=1)%>\n", args=list(K=50))
cat(x)

Decomposes a URL into its components

Description

Decomposes a URL into its components.

Usage

## Default S3 method:
splitUrl(url, ...)

Arguments

url

A character string.

...

Not used.

Value

Returns a named list of URL components.

Author(s)

Henrik Bengtsson

References

[1] https://en.wikipedia.org/wiki/URI_scheme


Starts the HTTP daemon and launches the help page

Description

Starts the HTTP daemon and launches the help page.

Usage

## S3 method for class 'HttpDaemon'
startHelp(static, ...)

Arguments

...

Arguments passed to *openUrl().

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Subsets an RspDocument

Description

Subsets an RspDocument.

Usage

## S3 method for class 'RspDocument'
subset(x, subset, ...)

Arguments

subset

An expression used for subsetting.

...

Not used.

Value

Returns an RspDocument.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Drops all text-outputting calls from the source code

Description

Drops all text-outputting calls from the source code.

Usage

## S3 method for class 'RspSourceCode'
tangle(...)

Arguments

...

Not used.

Value

Returns a RspSourceCode objects.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCode.


Tidy up the RSP source code

Description

Tidy up the RSP source code.

Usage

## S3 method for class 'RspSourceCode'
tidy(object, format=c("asis"), collapse="\n", ...)

Arguments

format

A character string specifying how the source code should be tidied.

collapse

How source code lines should be collapsed.

...

Not used.

Value

Returns an @RspSourceCode of the same class as the input source code.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCode.


Escapes character strings to become LaTeX compatible

Description

Escapes character strings to become LaTeX compatible.

Usage

## S3 method for class 'character'
toLatex(object, ...)

Arguments

object

A character vector of N strings.

...

Not used.

Value

A character vector of N strings.

Author(s)

Henrik Bengtsson

See Also

toLatex for escaping sessionInfo objects.


Translates the RSP document into R source code

Description

Translates the RSP document into R source code.

Usage

## S3 method for class 'RspDocument'
toR(object, factory=NULL, ...)

Arguments

factory

A RspSourceCodeFactory.

...

Optional arguments passed to toSourceCode() for the RspSourceCodeFactory.

Value

Returns the R source code as an RspRSourceCode.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Parses and translates the RSP string into R code

Description

Parses and translates the RSP string into R code.

Usage

## S3 method for class 'RspString'
toR(object, envir=parent.frame(), ...)

Arguments

envir

The environment where the RSP string is preprocessed.

...

Not used.

Value

Returns the code as an RspRSourceCode.

Author(s)

Henrik Bengtsson

See Also

For more information see RspString.


Translates an RSP document to source code

Description

Translates an RSP document to source code.

Usage

## S3 method for class 'RspSourceCodeFactory'
toSourceCode(object, doc, ...)

Arguments

...

Not used.

Value

Returns the generated source code as a RspSourceCode object.

Author(s)

Henrik Bengtsson

See Also

For more information see RspSourceCodeFactory.


Trims each of the RSP constructs

Description

Trims each of the RSP constructs.

Usage

## S3 method for class 'RspDocument'
trim(object, ..., verbose=FALSE)

Arguments

...

Not used.

verbose

See Verbose.

Value

Returns the trimmed RspDocument.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Trims all non-text RSP constructs

Description

Trims all non-text RSP constructs.

Usage

## S3 method for class 'RspDocument'
trimNonText(object, ..., verbose=FALSE)

Arguments

...

Not used.

verbose

See Verbose.

Details

For this method to work properly, the RspDocument should not contain any RspUnparsedDirective:s or RspUnparsedExpression:s, i.e. they should already have been parsed.

Value

Returns an RspDocument.

Author(s)

Henrik Bengtsson

See Also

For more information see RspDocument.


Checks whether an Rnw file is a Sweave or a knitr file

Description

Checks whether an Rnw file is a Sweave or a knitr file.

Usage

## Default S3 method:
typeOfRnw(filename, path=NULL, default="application/x-sweave", ...)

Arguments

filename, path

The filename and (optional) path of the Rnw file.

default

A character string specifying the default result.

...

Not used.

Value

Returns a character string.

Author(s)

Henrik Bengtsson

See Also

TBA.


Views the RSP product

Description

Views the RSP product.

Usage

## S3 method for class 'RspProduct'
view(...)

Arguments

...

Not used.

Value

Returns the RSP product (invisibly).

Author(s)

Henrik Bengtsson

See Also

For more information see RspProduct.


Writes a string to the HTTP output connection

Description

Writes a string to the HTTP output connection.

Usage

## S3 method for class 'HttpDaemon'
writeResponse(static, ...)

Arguments

...

A set of character strings to be outputted.

Details

Note: For efficiency, there is no check if the HTTP daemon is started or not.

Value

Returns (invisibly) the number of characters written.

Author(s)

Henrik Bengtsson

See Also

For more information see HttpDaemon.


Writes an RSP response to the predefined output

Description

Writes an RSP response to the predefined output.

Usage

## S3 method for class 'RspResponse'
writeResponse(...)

Arguments

...

Objects to be pasted together and outputted.

Value

Returns nothing.

Author(s)

Henrik Bengtsson

See Also

For more information see RspResponse.