loading...

For is_help(), determine if 'topic' has a help file and example to run. For is_win() and is_mac(), determine if the platform is Windows or MacOS. For is_aqua(), is the R UI is AQUA, the standard R GUI under Macintosh? For is_rgui(), determine if the default Rgui under Windows is in use, and with is_sdi() in this case, you can check if it is in SDI (single-document interface) versus MDI (multi-document interface, by default). is_rstudio() and is_rstudio_server() check if R is run under RStudio (server), and is_jgr() indicate if the R GUI is JGR.

is_help(topic, package = NULL, lib.loc = NULL)

is_win()

is_rgui()

is_sdi()

is_mac()

is_aqua()

is_rstudio()

is_rstudio_desktop()

is_rstudio_server()

is_jgr()

isHelp(topic, package = NULL, lib.loc = NULL)

isWin()

isRgui()

isSDI()

isMac()

isAqua()

isJGR()

Arguments

topic

Name or literal character string: the online help topic to look for.

package

A character vector giving the package names to look into for help or example code, or NULL. By default, all packages in the search path are used.

lib.loc

A character vector of directory names of R libraries, or NULL. The default value of NULL corresponds to all libraries currently known. If the default is used, the loaded packages are searched before the libraries.

Value

All these functions return either TRUE or FALSE depending on the tested item, except for is_help(), which returns a logical vector with two elements. The first one indicating if there is a help file, and the second one indicating if there are examples associated with this help file.

Note

The code of is_help() is largely inspired from the first part of example().

Under Rgui, to switch fro MDI to SDI more, go to the menu entry 'Edit' -> 'GUI preferences' to change the Rgui mode, or start Rgui with the '--SDI' argument line parameter. Under another platform than Windows or if it is not Rgui, then is_sdi() always returns FALSE.`

Examples

is_help("help")    # Help and example
#>    help example 
#>    TRUE    TRUE 
is_help("Rtangle")  # Help but no example
#>    help example 
#>    TRUE    TRUE 
is_help("notopic")  # No help or example
#>    help example 
#>   FALSE   FALSE 

is_win()
#> [1] FALSE
is_mac()
#> [1] FALSE

is_aqua()
#> [1] FALSE
is_rgui()
#> [1] FALSE
is_sdi()
#> [1] FALSE
is_rstudio()
#> [1] FALSE
is_rstudio_desktop()
#> [1] FALSE
is_rstudio_server()
#> [1] FALSE
is_jgr()
#> [1] FALSE