设为首页收藏本站获取积分奖励

R语言中文网

 找回密码
 立即注册
查看: 549|回复: 0

R语言从存储库或本地文件安装软件包install.packages()函数-中英文对照帮助文档

[复制链接]
发表于 2020-8-21 08:05:59 | 显示全部楼层 |阅读模式
        R语言从存储库或本地文件安装软件包install.packages()函数-中英文对照帮助文档

                                         By MicroRbt Martinez PhD

R语言函数名:install.packages()
R语言函数功能:从存储库或本地文件安装软件包
来自资源库:基础库(R语言自带)
install.packages()函数所属R语言包:所在R包具体名称、包功能的中英文双语描述见正文后面'--所在R语言包信息--'部分。

描述-----Description-----

Download and install packages from CRAN-like repositories or from local files.
从类似CRAN的存储库或本地文件下载并安装软件包。


使用方法-----Usage-----

install.packages(pkgs, lib, repos = getOption("repos"),
contriburl = contrib.url(repos, type),
method, available = NULL, destdir = NULL,
dependencies = NA, type = getOption("pkgType"),
configure.args = getOption("configure.args"),
configure.vars = getOption("configure.vars"),
clean = FALSE, Ncpus = getOption("Ncpus", 1L),
verbose = getOption("verbose"),
libs_only = FALSE, INSTALL_opts, quiet = FALSE,
keep_outputs = FALSE, ...)

参数-----Arguments-----

参数pkgs介绍: character vector of the names of packages whose current versions should be downloaded from the repositories.
应从存储库下载当前版本的软件包名称的字符向量。

If repos = NULL, a character vector of file paths,
如果是repos = NULL,即文件路径的字符向量,


on windows,
file paths of <code>.zip</code> files containing binary builds of packages. (http:// and file:// URLs are also accepted and the files will be downloaded and installed from local copies.) Source directories or file paths or URLs of archives may be specified with type = "source", but some packages need suitable tools installed (see the Details section).
包含软件包的二进制版本的<code>.zip </ code>文件的文件路径。 (http://和file:// URL也被接受,并且将从本地副本下载并安装文件。)type = "source"可以指定源目录或文件路径或归档的URL,但是某些软件包需要安装合适的工具(请参阅Details部分)。


these file paths can be source directories or archives or binary package archive files (as created by R CMD build --binary). (http:// and file:// URLs are also accepted and the files will be downloaded and installed from local copies.) On a CRAN build of R for macOS these can be <code>.tgz</code> files containing binary package archives. Tilde-expansion will be done on file paths.
这些文件路径可以是源目录,归档文件或二进制软件包归档文件(由R CMD build --binary创建)。 (也接受http://和file:// URL,并且将从本地副本下载和安装文件。)在macOS的R的CRAN版本中,这些文件可能是包含二进制软件包存档的<code>.tgz </ code>文件。波形扩展将在文件路径上完成。



If this is missing, a listbox of available packages is presented where possible in an interactive R session.
如果缺少此列表,则在交互式R会话中尽可能显示可用软件包的列表框。

参数lib介绍: character vector giving the library directories where to install the packages. Recycled as needed. If missing, defaults to the first element of .libPaths().
字符向量,提供库目录在何处安装软件包。根据需要回收。如果缺失,则默认为.libPaths()的第一个元素。

参数repos介绍: character vector, the base URL(s) of the repositories to use, e.g., the URL of a CRAN mirror such as "https://cloud.r-project.org". For more details on supported URL schemes see url.
字符向量,要使用的存储库的基本URL,例如CRAN镜像的URL,例如"https://cloud.r-project.org"。有关支持的URL方案的更多详细信息,请参见url。

Can be NULL to install from local files, directories or URLs: this will be inferred by extension from pkgs if of length one.
可以NULL从本地文件,目录或URL安装:如果长度为1,则可以通过pkgs的扩展名来推断。

参数contriburl介绍: URL(s) of the contrib sections of the repositories. Use this argument if your repository mirror is incomplete, e.g., because you burned only the <code>contrib</code> section on a CD, or only have binary packages. Overrides argument repos. Incompatible with type = "both".
存储库的contrib部分的URL。如果您的存储库镜像不完整,请使用此参数,例如,因为仅刻录了CD上的<code>contrib </ code>部分,或者仅包含二进制软件包。覆盖参数repos。与type = "both"不兼容。

参数method介绍: download method, see download.file. Unused if a non-NULL available is supplied.
下载方法,请参阅download.file。如果提供了非NULL available,则不使用。

参数available介绍: a matrix as returned by available.packages listing packages available at the repositories, or NULL when the function makes an internal call to available.packages. Incompatible with type = "both".
由available.packages列出存储库中可用软件包的列表返回的矩阵,或者当函数对available.packages进行内部调用时返回的矩阵NULL。与type = "both"不兼容。

参数destdir介绍: directory where downloaded packages are stored. If it is NULL (the default) a subdirectory downloaded_packages of the session temporary directory will be used (and the files will be deleted at the end of the session).
已下载软件包的存储目录。如果它是NULL(默认值),则将使用会话临时目录的子目录downloaded_packages(并且文件将在会话结束时删除)。

参数dependencies介绍: logical indicating whether to also install uninstalled packages which these packages depend on/link to/import/suggest (and so on recursively). Not used if repos = NULL. Can also be a character vector, a subset of c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances").
逻辑指示是否还要安装这些软件包所依赖/链接到/导入/建议的卸载软件包(以此类推)。如果repos = NULL不使用。也可以是字符向量,是c("Depends", "Imports", "LinkingTo", "Suggests", "Enhances")的子集。

Only supported if lib is of length one (or missing), so it is unambiguous where to install the dependent packages. If this is not the case it is ignored, with a warning.
仅当lib的长度为1(或缺少长度)时才受支持,因此在哪里安装依赖软件包是明确的。如果不是这种情况,则将其忽略并显示警告。

The default, NA, means c("Depends", "Imports", "LinkingTo").
默认值为NA,表示c("Depends", "Imports", "LinkingTo")。

TRUE means to use c("Depends", "Imports", "LinkingTo", "Suggests") for pkgs and c("Depends", "Imports", "LinkingTo") for added dependencies: this installs all the packages needed to run pkgs, their examples, tests and vignettes (if the package author specified them correctly).
TRUE表示将c("Depends", "Imports", "LinkingTo", "Suggests")用于pkgs,并使用c("Depends", "Imports", "LinkingTo")来添加依赖项:这将安装运行pkgs,其示例,测试和小插图所需的所有软件包(如果软件包作者正确指定了它们)。

In all of these, "LinkingTo" is omitted for binary packages.
在所有这些中,二进制软件包省略了"LinkingTo"。

参数type介绍: character, indicating the type of package to download and install. Will be "source" except on Windows and some macOS builds: see the section on Binary packages for those.
字符,指示要下载和安装的软件包的类型。除Windows和某些macOS版本外,将为"source":有关这些信息,请参见Binary packages一节。

参数configure.args介绍: (Used only for source installs.) A character vector or a named list. If a character vector with no names is supplied, the elements are concatenated into a single string (separated by a space) and used as the value for the --configure-args flag in the call to R CMD INSTALL. If the character vector has names these are assumed to identify values for --configure-args for individual packages. This allows one to specify settings for an entire collection of packages which will be used if any of those packages are to be installed. (These settings can therefore be re-used and act as default settings.)
(仅用于源安装。)字符向量或命名列表。如果提供
-----未完,待续-----,↓↓↓展开剩余72%↓↓↓
购买主题 前行需要您的支持,请赞助作者 【15 金钱】 就能浏览全部100%内容啦!(本贴一次赞助、永久可读)
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|R语言中文网    

GMT+8, 2024-5-21 04:16 , Processed in 0.027768 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表