The string is evaluated in the parent environment. See
base::eval for the definition of environments in R.
Author(s)
Alexander Robitzsch
Examples
# This function is simply a shortage function
# See the definition of this function:
Reval <- function( Rstring , print.string=TRUE){
if (print.string){ cat( paste( Rstring ) , "\n" ) }
eval.parent( parse( text = paste( Rstring )) , n=1 )
}
Reval( "a <- 2^3" )
## a <- 2^3
a
## [1] 8