

   is.R {base}                                  R Documentation

   AArree wwee uussiinngg RR,, rraatthheerr tthhaann SS??

   DDeessccrriippttiioonn::

        Test if running under R.

   UUssaaggee::

        is.R()

   DDeettaaiillss::

        The function has been written such as to correctly run
        in all versions of R, S and S-PLUS.  In order for code
        to be runnable in both R and S dialects, either your
        the code must define `is.R' or use it as

        `if (exists(is.R) && is.function(is.R) && is.R()) {'
        `    '.br `} else {'
        `    '.br `}'

   VVaalluuee::

        `is.R' returns `TRUE' if we are using R and `FALSE'
        otherwise.

   SSeeee AAllssoo::

        `R.version', `system'.

   EExxaammpplleess::

        x <- runif(20); small <- x < 0.4
        # which only exists in R:
        if(is.R()) which(small) else seq(along=small)[small]

