R语言install.packages函数帮助文档中英对照

第一部分:获取文档

已知函数名时,可以在Rstudio中输入help(“函数名”)获取该函数的帮助文档。
这里获取install.packages函数文档的代码:

help("install.packages")

这里写图片描述
从图中可以看到install.packages函数存在于{utils}工具包中。
另一种方法,已知包名utils时,可以通过包名utils查找到函数。获取帮助文档:help.start()
这里写图片描述
打开帮助文档页面,选择packages:
这里写图片描述
选择utils的install.packages函数:
这里写图片描述这里写图片描述


第二部分:文档剖析

install.packages {utils}
函数名 {包名}
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 of ‘.zip’ 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).If this is missing or a zero-length character vector, a listbox of available packages is presented where possible in an interactive R session.
中文 字符向量,指向需要下载的包在存储库中当前版本对应的包名。如果repos参数值为空,则该字符向量对应着一个文件:默认存储库路径下已经存在的一个二进制zip文件(如果是从本地副本文件下载并安装,用“http://”或者“file://URL”Z作为字符向量参数也是被接受的)源目录或文件路径或URL需要使用type =“source”来特别指定,但某些软件包需要安装适配的工具(请参阅“详细信息”部分)。如果没有输入该参数或参数字符长度为0,在交互式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 “h
  • 4
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值