
cmsy_install_jags(): 下载并打开JAGS安装程序
Source:vignettes/articles/zh/reference/cmsy_install_jags.Rmd
cmsy_install_jags.Rmd英文原页:cmsy_install_jags()
说明
本函数下载与操作系统和R版本匹配的JAGS安装程序(见cmsy_jags_versions()和cmsy_download_jags()),核对文件大小和校验值,然后打开它:Windows上是.exe安装程序,macOS上是.pkg安装程序。在Linux上则下载源代码,并说明如何用包管理器或从源代码安装JAGS。如果在包的inst/jags/文件夹(安装后为jags/)中放有安装程序,则直接使用该文件,不再下载。
English
This function downloads the JAGS installer that matches the operating
system and R version (see cmsy_jags_versions() and
cmsy_download_jags()), checks its size and checksums, and
opens it: the .exe installer on Windows and the
.pkg installer on macOS. On Linux it downloads the source
code and shows how to install JAGS with the package manager or from
source. An installer placed in the package folder
inst/jags/ (installed as jags/) is used
instead of downloading.
用法
cmsy_install_jags(
version = "recommended",
os = "auto",
open = TRUE,
data_dir = fao_data_dir(),
silent = fao_setting("silent")
)参数
version-
JAGS版本:“recommended”(默认)、“latest”或版本号。
English
The JAGS version: “recommended” (default), “latest” or a version number. os-
采用哪个操作系统的设置:“auto”(默认,自动检测)、“windows”、“macos”或”linux”。
English
The operating system whose settings are used: “auto” (default, detect it), “windows”, “macos” or “linux”. open-
逻辑值。为TRUE(默认)时打开安装程序。
English
A logical value. If TRUE (default), the installer is opened. data_dir-
下载文件的保存目录。默认为
fao_data_dir()。English
The directory where downloads are kept. Default isfao_data_dir(). silent-
逻辑值。为TRUE时不输出汇总信息。默认为FALSE,或
fao_settings(silent = )设置的值。English
A logical value. If TRUE, no summary is printed. Default is FALSE, or the value set withfao_settings(silent = ).
参考文献
Plummer, M. (2003). JAGS: A program for analysis of Bayesian graphical models using Gibbs sampling. Proceedings of the 3rd International Workshop on Distributed Statistical Computing (DSC 2003), Vienna. https://mcmc-jags.sourceforge.io/
示例
# Download the installer for this system (size and checksum are checked) and open it
cmsy_install_jags()
# Only download it, e.g. to install it later
path <- cmsy_install_jags(open = FALSE)
# Download the Windows installer on a Mac, e.g. for a colleague
cmsy_install_jags(os = "windows", open = FALSE)