R/RspString.toR.R

#########################################################################/**
# @set "class=RspString"
# @RdocMethod toR
#
# @title "Parses and translates the RSP string into R code"
#
# \description{
#  @get "title".
# }
#
# @synopsis
#
# \arguments{
#   \item{envir}{The @environment where the RSP string is preprocessed.}
#   \item{...}{Not used.}
# }
#
# \value{
#  Returns the code as an @see "RspRSourceCode".
# }
#
# @author
#
# \seealso{
#   @seeclass
# }
#*/#########################################################################
setMethodS3("toR", "RspString", function(object, envir=parent.frame(), ...) {
  expr <- parseExpression(object, preprocess=TRUE, envir=envir, ...)
  toR(expr, ...)
}, protected=TRUE) # toR()



#########################################################################/**
# @RdocMethod evaluate
#
# @title "Parses, translates, and evaluates the RSP string"
#
# \description{
#  @get "title".
# }
#
# @synopsis
#
# \arguments{
#   \item{envir}{The @environment where the RSP string is evaluated.}
#   \item{...}{Not used.}
# }
#
# \value{
#  Returns the last evaluated expression, iff any.
# }
#
# @author
#
# \seealso{
#   @seeclass
# }
#*/#########################################################################
setMethodS3("evaluate", "RspString", function(object, envir=parent.frame(), ...) {
  rCode <- toR(object, ...)
  process(rCode, envir=envir, ...)
}, createGeneric=FALSE)

Try the R.rsp package in your browser

Any scripts or data that you put into this service are public.

R.rsp documentation built on June 28, 2022, 1:05 a.m.