Rev 85363 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed
% File src/library/base/man/use.Rd% Part of the R package, https://www.R-project.org% Copyright 2023 R Core Team% Distributed under GPL 2 or later\name{use}\title{Use Packages}\alias{.use}\description{Use packages in R scripts by loading their namespace and attaching apackage environment including (a subset of) their exports to thesearch path.}\usage{.use(package, lib.loc = NULL, include.only)}\arguments{\item{package}{a character string given the name of a package.}\item{lib.loc}{a character vector describing the location of \Rlibrary trees to search through, or \code{NULL}. The default valueof \code{NULL} corresponds to all libraries currently known to\code{\link{.libPaths}()}.Non-existent library trees are silently ignored.}\item{include.only}{character vector of names of objects toinclude in the attached environment frame. If missing, all exportsare included.}}\details{This is a simple wrapper around \code{\link{library}} which alwaysuses \code{attach.required = FALSE}, so that packages listed in the\code{Depends} clause of the \code{DESCRIPTION} file of the package tobe used never get attached automatically to the search path.This therefore allows to write R scripts with full control over whatgets found on the search path. In addition, such scripts can easilybe integrated as package code, replacing the calls to \code{use} bythe corresponding \code{ImportFrom} directives in \file{NAMESPACE}files.}\value{(invisibly) a logical indicating whether the package to be used isavailable.}\note{This functionality is still experimental: interfaces may change infuture versions.Name temporarily changed from \code{use} to \code{.use} to avoidCRAN breakage.}