File: use_import_from.Rd

package info (click to toggle)
r-cran-usethis 3.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,228 kB
  • sloc: sh: 26; makefile: 17; cpp: 6; ansic: 3
file content (34 lines) | stat: -rw-r--r-- 1,134 bytes parent folder | download
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
34
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/use_import_from.R
\name{use_import_from}
\alias{use_import_from}
\title{Import a function from another package}
\usage{
use_import_from(package, fun, load = is_interactive())
}
\arguments{
\item{package}{Package name}

\item{fun}{A vector of function names}

\item{load}{Logical. Re-load with \code{\link[pkgload:load_all]{pkgload::load_all()}}?}
}
\value{
Invisibly, \code{TRUE} if the package document has changed, \code{FALSE} if not.
}
\description{
\code{use_import_from()} imports a function from another package by adding the
roxygen2 \verb{@importFrom} tag to the package-level documentation (which can be
created with \code{\link[=use_package_doc]{use_package_doc()}}). Importing a function from another
package allows you to refer to it without a namespace (e.g., \code{fun()} instead
of \code{package::fun()}).

\code{use_import_from()} also re-documents the NAMESPACE, and re-load the current
package. This ensures that \code{fun} is immediately available in your development
session.
}
\examples{
\dontrun{
use_import_from("glue", "glue")
}
}