1% File src/library/utils/man/getAnywhere.Rd
2% Part of the R package, https://www.R-project.org
3% Copyright 1995-2012 R Core Team
4% Distributed under GPL 2 or later
5
6\name{getAnywhere}
7\alias{getAnywhere}
8\alias{argsAnywhere}
9\alias{[.getAnywhere}
10\alias{print.getAnywhere}
11\title{Retrieve an R Object, Including from a Namespace}
12\description{
13  These functions locate all objects with name matching their argument,
14  whether visible on the search path, registered as an S3 method or in a
15  namespace but not exported.  \code{getAnywhere()} returns the objects
16  and \code{argsAnywhere()} returns the arguments of any objects that
17  are functions.
18}
19\usage{
20getAnywhere(x)
21argsAnywhere(x)
22}
23\arguments{
24  \item{x}{a character string or name.}
25}
26\details{
27  These functions look at all loaded namespaces, whether or not they are
28  associated with a package on the search list.
29
30  They do not search literally \dQuote{anywhere}: for example, local
31  evaluation frames and namespaces that are not loaded will not be
32  searched.
33
34  Where functions are found as registered S3 methods, an attempt is
35  made to find which namespace registered them.  This may not be
36  correct, especially if namespaces have been unloaded.
37}
38\value{
39  For \code{getAnywhere()} an object of class \code{"getAnywhere"}.
40  This is a list with components
41  \item{name}{the name searched for}
42  \item{objs}{a list of objects found}
43  \item{where}{a character vector explaining where the object(s) were found}
44  \item{visible}{logical: is the object visible}
45  \item{dups}{logical: is the object identical to one earlier in the
46    list.}
47  In computing whether objects are identical, their environments are ignored.
48
49  Normally the structure will be hidden by the \code{print} method.
50  There is a \code{[} method to extract one or more of the objects
51  found.
52
53  For \code{argsAnywhere()} one or more argument lists as returned by
54  \code{\link{args}}.
55}
56\seealso{
57  \code{\link{getS3method}} to find the method which would be used: this
58  might not be the one of those returned by \code{getAnywhere} since it
59  might have come from a namespace which was unloaded or be registered
60  under another name.
61
62  \code{\link{get}},  \code{\link{getFromNamespace}}, \code{\link{args}}
63}
64\examples{
65getAnywhere("format.dist")
66getAnywhere("simpleLoess") # not exported from stats
67argsAnywhere(format.dist)
68}
69\keyword{data}
70