\Header{getFromNamespace}{Utility functions for Developing Namespaces}
\alias{fixInNamespace}{getFromNamespace}
\keyword{data}{getFromNamespace}
\begin{Description}\relax
Utility functions to access and replace the non-exported functions in
a namespace, for use in developing packages with namespaces.\end{Description}
\begin{Usage}
\begin{verbatim}
getFromNamespace(x, ns, pos = -1, envir = as.environment(pos))
fixInNamespace(x, ns, pos = -1, envir = as.environment(pos), ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object name (given as a character string).
\item[\code{ns}] a namespace, or character string giving the namespace.
\item[\code{pos}] where to look for the object: see \code{\Link{get}}.
\item[\code{envir}] an alternative way to specify an environment to look in.
\item[\code{...}] arguments to pass to the editor: see \code{\Link{edit}}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
The namespace can be specified in several ways.  Using, for example,
\code{ns="modreg"} is the most direct, but a loaded package with a
namespace can be specified via any of the methods used for
\code{\Link{get}}: \code{ns} can also be the environment
\code{<namespace:foo>}.

\code{fixInNamespace} invokes \code{\Link{edit}} on the object named
\code{x} and assigns the revised object in place of the original
object.  For compatibility with \code{fix}, \code{x} can be unquoted.\end{Details}
\begin{Value}
\code{getFromNamespace} returns the object found (or gives an error).

\code{fixInNamespace} is invoked for its side effect of changing the
object in the namespace.\end{Value}
\begin{Note}\relax
\code{fixInNamespace} will alter the copy of the object in the
namespace, and also a copy registered as an S3 method.  There can be other
copies, so the function is not foolproof, but should be helpful for
debugging.\end{Note}
\begin{SeeAlso}\relax
\code{\Link{get}}, \code{\Link{fix}}, \code{\Link{getS3method}}\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}## Don't run: 
fixInNamespace("predict.ppr", "modreg")
## alternatively
fixInNamespace("predict.ppr", pos = 5)
## End Don't run\end{ExampleCode}
\end{Examples}

