if.R: Conditional Execution for R or S-Plus

Description Usage Arguments Details Value Author(s) See Also Examples

Description

if.R uses the is.R function to determine whether to execute the expression in the r argument or the expression in the s argument.

Usage

1
if.R(r, s)

Arguments

r

Any R expression, including a group of expressions nested in braces. Assignments made in this expression are available to the enclosing function.

s

Any S-Plus expression, including a group of expressions nested in braces. Assignments made in this expression are available to the enclosing function.

Details

Not all functions are in both implementations of the S language. In particular, panel functions for lattice in R (based on grid graphics) are very different from panel functions for trellis (based on the older graphics technology) in S-Plus.

Value

The result of the executed expression.

Author(s)

Richard M. Heiberger <rmh@temple.edu>

See Also

is.R

Examples

1
2
 if.R(r={"This is R."},
      s={"This is S-Plus"})

Example output

Loading required package: lattice
Loading required package: grid
Loading required package: latticeExtra
Loading required package: multcomp
Loading required package: mvtnorm
Loading required package: survival
Loading required package: TH.data
Loading required package: MASS

Attaching package:TH.dataThe following object is masked frompackage:MASS:

    geyser

Loading required package: gridExtra
[1] "This is R."

HH documentation built on Nov. 28, 2020, 9:06 a.m.

Related to if.R in HH...