Rev 49852 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/utils/man/help.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2009 R Core Development Team% Distributed under GPL 2 or later\name{help}\alias{help}\title{Documentation}\description{\code{help} is the primary interface to the help systems.}\usage{help(topic, package = NULL, lib.loc = NULL,verbose = getOption("verbose"),try.all.packages = getOption("help.try.all.packages"),help_type = getOption("help_type"),chmhelp = getOption("chmhelp"),htmlhelp = getOption("htmlhelp"),offline = FALSE)}\arguments{\item{topic}{usually, a \link{name} or character string specifying thetopic for which help is sought. A character string (enclosed inexplicit single or double quotes) is always taken as naming a topic.If the value of \code{topic} is a length-onecharacter vector the topic is taken to be the value of the onlyelement. Otherwise \code{topic} must be a name or a \link{reserved}word (if syntactically valid) or character string.See \sQuote{Details} for what happens if this is omitted.}\item{package}{a name or character vector giving the packages to lookinto for documentation, or \code{NULL}. By default, all packages inthe search path are used. To avoid a name being deparsed use e.g.\code{(pkg_ref)}.}\item{lib.loc}{a character vector of directory names of \R libraries,or \code{NULL}. The default value of \code{NULL} corresponds to alllibraries currently known. If the default is used, the loadedpackages are searched before the libraries.}\item{verbose}{logical; if \code{TRUE}, the file name is reported.}\item{try.all.packages}{logical; see \code{Note}.}\item{help_type}{character string: the type of help required.Possible values are \code{"text"}, \code{"html"},\code{"postscript"}, \code{"ps"} and \code{"pdf"}. Case is ignored,and partial matching is allowed.}\item{chmhelp}{a deprecated way to specify \code{help_type = "text"}.}\item{htmlhelp}{a deprecated way to specify \code{help_type = "html"}.}\item{offline}{a deprecated way to specify \code{help_type = "postscript"}.}}\details{The following types of help are available:\itemize{\item Plain text help\item HTML help pages with hyperlinks to other topics, shown in abrowser by \code{\link{browseURL}}.#ifdef unix(Where possible an existing browser window is re-used: the Mac OS XGUI uses its own browser window.)#endifIf for some reason HTML help is unavailable (see\code{\link{startDynamicHelp}}), plain text help will be usedinstead.\item For \code{help} only, typeset as a PostScript or PDF file --see the section on \sQuote{Offline help}.}#ifdef unixThe \sQuote{factory-fresh} default is text help except from the Mac OSGUI, which uses HTML help displayed in its own browser window.#endif#ifdef windowsThe defaults for the type of help are selected when \R is installed --the \sQuote{factory-fresh} default is HTML help.#endifWith packages installed under \R{} 2.10.0 or later help pages aregenerated when needed from parsed Rd files. Packages installed underearlier versions of \R do not have parsed Rd files, but do (bydefault) have prebuilt text, html and latex help pages, and these areused if parsed Rd files are not available.The rendering of text help will use directional quotes in suitablelocales (UTF-8 and single-byte Windows locales): sometimes the fontsused do not support these quotes so this can be turned off by setting\code{\link{options}(useFancyQuotes = FALSE)}.\code{topic} is not optional: if it is omitted \R will give (text)information on the package (including hints to suitable help topics)if a package is specified, a (text) list of available packages if\code{lib.loc} only is specified, and help on \code{help} itself ifnone of the first three arguments is specified.Some topics need to be quoted (by \link{backtick}s) or given as acharacter string. There include those which cannot syntacticallyappear on their own such as unary and binary operators,\code{function} and control-flow \link{reserved} words (including\code{if}, \code{else} \code{for}, \code{in}, \code{repeat},\code{while}, \code{break} and \code{next}. The other \code{reserved}words can be used as if they were names, for example \code{TRUE},\code{NA} and \code{Inf}.If multiple help files matching \code{topic} are found, in interactiveuse a menu is presented for the user to choose one: in batch use thefirst on the search path is used. (For HTML help the menu will be anHTML page, otherwise a graphical menu if possible if\code{\link{getOption}("menu.graphics")} is true, the default.)}\section{Offline help}{Typeset documentation is produced by running the LaTeX version of thehelp page through \command{latex} and \command{dvips} or, if\code{help_type = "PDF"}, \command{pdflatex}. This will eitherproduce a PostScript or PDF file or (depending on the configuration of\command{dvips}) send a PostScript file to a printer.The appearance of the output can be customized through a file\file{Rhelp.cfg} somewhere in your LaTeX search path: this will beinput as a LaTeX style file after \code{Rd.sty}. Some\link{environment variables} are consulted, notably \env{R_PAPERSIZE}(\emph{via} \code{getOption("papersize")}) and \env{R_RD4DVI} /\env{R_RD4PDF} (see \sQuote{Making manuals} in the\sQuote{R Installation and Administration Manual}).If there is a function \code{offline_help_helper} in the workspace orfurther down the search path it is used to do the typesetting,otherwise the function of that name in the \code{utils} name space(to which the first paragraph applies). It should have twoarguments, the name of the LaTeX file to be typeset and the type.}\note{Unless \code{lib.loc} is specified explicitly, the loaded packages aresearched before those in the specified libraries. This ensures thatif a library is loaded from a library not in the known library trees,then the help from the loaded library is used. If \code{lib.loc} isspecified explicitly, the loaded packages are \emph{not} searched.If this search fails and argument \code{try.all.packages} is\code{TRUE} and neither \code{packages} nor \code{lib.loc} isspecified, then all the packages in the known library trees aresearched for help on \code{topic} and a list of (any) packages wherehelp may be found is displayed (with hyperlinks for \code{help_type ="html"}). \strong{NB:} searching all packages can be slow.}\references{Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988)\emph{The New S Language}.Wadsworth & Brooks/Cole.}\seealso{\code{\link[=Question]{?}} for shortcuts to help topics.\code{\link{help.search}()} or \code{\link{??}} for finding help pageson a vague topic;\code{\link{help.start}()} which opens the HTML version of the \Rhelp pages;\code{\link{library}()} for listing available packages and thehelp objects they contain;\code{\link{data}()} for listing available data sets;\code{\link{methods}()}.Use \code{\link{prompt}()} to get a prototype for writing \code{help}pages of your own package.}\examples{help()help(help) # the samehelp(lapply)help("for") # or ?"for", but quotes/backticks are neededhelp(package="splines") # get help even when package is not loadedtopi <- "women"help(topi)try(help("bs", try.all.packages=FALSE)) # reports not found (an error)help("bs", try.all.packages=TRUE) # reports can be found# in package 'splines'}\keyword{documentation}