1
#########################################################################/**
2
# @set "class=RspString"
3
# @RdocMethod toR
4
#
5
# @title "Parses and translates the RSP string into R code"
6
#
7
# \description{
8
#  @get "title".
9
# }
10
#
11
# @synopsis
12
#
13
# \arguments{
14
#   \item{envir}{The @environment where the RSP string is preprocessed.}
15
#   \item{...}{Not used.}
16
# }
17
#
18
# \value{
19
#  Returns the code as an @see "RspRSourceCode".
20
# }
21
#
22
# @author
23
#
24
# \seealso{
25
#   @seeclass
26
# }
27
#*/#########################################################################
28
setMethodS3("toR", "RspString", function(object, envir=parent.frame(), ...) {
29 0
  expr <- parseExpression(object, preprocess=TRUE, envir=envir, ...)
30 0
  toR(expr, ...)
31
}, protected=TRUE) # toR()
32

33

34

35
#########################################################################/**
36
# @RdocMethod evaluate
37
#
38
# @title "Parses, translates, and evaluates the RSP string"
39
#
40
# \description{
41
#  @get "title".
42
# }
43
#
44
# @synopsis
45
#
46
# \arguments{
47
#   \item{envir}{The @environment where the RSP string is evaluated.}
48
#   \item{...}{Not used.}
49
# }
50
#
51
# \value{
52
#  Returns the last evaluated expression, iff any.
53
# }
54
#
55
# @author
56
#
57
# \seealso{
58
#   @seeclass
59
# }
60
#*/#########################################################################
61
setMethodS3("evaluate", "RspString", function(object, envir=parent.frame(), ...) {
62 0
  rCode <- toR(object, ...)
63 0
  process(rCode, envir=envir, ...)
64
}, createGeneric=FALSE)

Read our documentation on viewing source code .

Loading