Hen*_*ndy 5 configuration r unzip
我试图安装ramnathv 的slidify软件包,但对以下错误感到惊讶:
# install.packages("devtools")
library(devtools)
install_github("slidify","ramnathv")
Installing github repo slidify/master from ramnathv
Downloading slidify.zip from https://github.com/ramnathv/slidify/archive/master.zip
Installing package from /tmp/RtmpOFEJuD/slidify.zip
Error in unzip(src, exdir = target, unzip = getOption("unzip")) :
'unzip' must be a single character string
Run Code Online (Sandbox Code Playgroud)
我之前使用相同的 Arch Linux 设置和他们的 R 包在另一个系统上安装它没有问题,当然它是 R 的早期版本(3.0.0 或 3.0.1)。
在谷歌搜索错误,它来自这个位zip.R:
unzip <-
function(zipfile, files = NULL, list = FALSE, overwrite = TRUE,
junkpaths = FALSE, exdir = ".", unzip = "internal",
setTimes = FALSE)
{
if(identical(unzip, "internal")) {
if(!list && !missing(exdir))
dir.create(exdir, showWarnings = FALSE, recursive = TRUE)
res <- .External(C_unzip, zipfile, files, exdir, list, overwrite,
junkpaths, setTimes)
if(list) {
dates <- as.POSIXct(res[[3]], "%Y-%m-%d %H:%M", tz="UTC")
data.frame(Name = res[[1]], Length = res[[2]], Date = dates,
stringsAsFactors = FALSE)
} else invisible(attr(res, "extracted"))
} else {
WINDOWS <- .Platform$OS.type == "windows"
if(!is.character(unzip) || length(unzip) != 1L || !nzchar(unzip))
stop("'unzip' must be a single character string")
...
Run Code Online (Sandbox Code Playgroud)
虽然默认设置unzip()是unzip = "internal",但也可以传递getOptions("unzip"):
Usage
unzip(zipfile, files = NULL, list = FALSE, overwrite = TRUE,
junkpaths = FALSE, exdir = ".", unzip = "internal",
setTimes = FALSE)
...
unzip
The method to be used. An alternative is to use getOption("unzip"),
which on a Unix-alike may be set to the path to a unzip program.
Run Code Online (Sandbox Code Playgroud)
在查看 的输出时.Options,我确实看到没有任何设置unzip:
> .Options$unzip
[1] ""
Run Code Online (Sandbox Code Playgroud)
从细读文件,我看到,我可以设置这~/.Renviron,但我的问题是,是否在Linux系统上这个应该是默认拾起或者如果它是非常标准有设置你的unzip命令?
如果取消填充这不是标准的,我将使用 Arch Linux 提交错误报告,因为也许该包是在没有默认情况下编译的,因为文档似乎表明,如果有的话,它将使用 unzip 命令填充安装过程中发现:
unzip
a character string, the path of the command used for unzipping help files, or
"internal". Defaults to the value of R_UNZIPCMD, which is set in ‘etc/Renviron’
if an unzip command was found during configuration.
Run Code Online (Sandbox Code Playgroud)
我正在使用的 Arch 包是一个二进制文件,因此是预编译的,所以可能有意或无意地忽略了这一点,或者应该在安装过程中检查?
PS只是为了避免明显的......
$ which unzip
/usr/bin/unzip
Run Code Online (Sandbox Code Playgroud)