Rev 61150 | Rev 67599 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/Rhome.Rd% Part of the R package, http://www.R-project.org% Copyright 1995-2011 R Core Team% Distributed under GPL 2 or later\name{Rhome}\alias{R.home}\alias{R_HOME}\title{Return the R Home Directory}\description{Return the \R home directory.}\usage{R.home(component = "home")}\arguments{\item{component}{As well as \code{"home"} which gives the \R homedirectory, other known values are \code{"bin"}, \code{"doc"},\code{"etc"}, \code{"modules"} and \code{"share"} giving the paths to thecorresponding parts of an \R installation.}}\details{The \R home directory is the top-level directory of the \Rinstallation being run.The \R home directory is often referred to as \var{R_HOME},and is the value of an environment variable of that name in an \Rsession.#ifdef unixIt can be found outside an \R session by \code{R \link{RHOME}}.#endif}\value{A character string giving the \R home directory or path to aparticular component. Normally the components are all subdirectoriesof the \R home directory, but this may not be the case in a Unix-likeinstallation.The return value for \code{"modules"} and on Windows \code{"bin"} isto a sub-architecture-specific location.The function \code{R.home()} bases the constructed paths on thecurrent value of the environment variable \env{R_HOME} which isnormally set on startup.On Windows the values of \code{R.home()} and \env{R_HOME} areguaranteed not to contain spaces, switching to the 8.3 short form ofpath elements if required. From \R 2.13.0 the value of \env{R_HOME}is set on startup to use forward slashes (since many packagemaintainers pass it unquoted to shells, for example in Makefiles).}\keyword{utilities}