if.R | R Documentation |

`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. `is.R`

, copied from the now defunct
base R function, returns `TRUE`

if running under R and returns
`FALSE`

otherwise (initially designed for S/S-PLUS).

```
if.R(r, s)
is.R()
```

`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. |

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.

`is.R`

is copied from the now defunct base R function of the same name.

For `if.R`

the result of the executed expression.

`is.R`

returns `TRUE`

if we are using R and `FALSE`

otherwise.

Richard M. Heiberger <rmh@temple.edu>

`R.Version`

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

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.