is_help: Check for the existence of an help file, or some context

Description Usage Arguments Value Note See Also Examples

View source: R/is_xxx.R

Description

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.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33

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

See Also

example(), help(), capabilities()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
is_help("help")		# Help and example
is_help("Rtangle")	# Help but no example
is_help("notopic")	# No help or example

is_win()
is_mac()

is_aqua()
is_rgui()
is_sdi()
is_rstudio()
is_rstudio_desktop()
is_rstudio_server()
is_jgr()

svMisc documentation built on Oct. 12, 2021, 1:08 a.m.