1

我正在使用 R 版本 3.4.0。我的电脑是64位windows 10。

我想从 R 中的 PDF 文档中提取数据帧。

我尝试使用 github 安装 tabulizer 包,但出现以下错误。

> ghit::install_github(c("ropenscilabs/tabulizerjars", "ropenscilabs/tabulizer"), INSTALL_opts = "--no-multiarch")
also installing the dependencies ‘httpuv’, ‘sourcetools’

also installing the dependency ‘rJava’

ropenscilabs/tabulizerjars     ropenscilabs/tabulizer 
                        NA                         NA 
There were 14 warnings (use warnings() to see them)
> library("tabulizer")
Error in library("tabulizer") : there is no package called ‘tabulizer’

警告如下,

> warnings()
Warning messages:
1: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/downloaded_packages/httpuv_1.3.3.tar.gz' had status 1
2: In utils::install.packages(suggests, type = type, repos = repos,  ... :
  installation of package ‘httpuv’ had non-zero exit status
3: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/downloaded_packages/sourcetools_0.1.6.tar.gz' had status 1
4: In utils::install.packages(suggests, type = type, repos = repos,  ... :
  installation of package ‘sourcetools’ had non-zero exit status
5: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/downloaded_packages/shiny_1.0.3.tar.gz' had status 1
6: In utils::install.packages(suggests, type = type, repos = repos,  ... :
  installation of package ‘shiny’ had non-zero exit status
7: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/downloaded_packages/miniUI_0.1.1.tar.gz' had status 1
8: In utils::install.packages(suggests, type = type, repos = repos,  ... :
  installation of package ‘miniUI’ had non-zero exit status
9: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/downloaded_packages/rJava_0.9-8.tar.gz' had status 1
10: In utils::install.packages(to_install, type = type, repos = repos,  ... :
  installation of package ‘rJava’ had non-zero exit status
11: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/ghitdrat/src/contrib/tabulizerjars_0.9.2.tar.gz' had status 1
12: In utils::install.packages(to_install, type = type, repos = repos,  ... :
  installation of package ‘tabulizerjars’ had non-zero exit status
13: running command '"C:/PROGRA~1/R/R-34~1.0/bin/x64/R" CMD INSTALL -l "C:\Users\akshay\Documents\R\win-library\3.4" C:\Users\akshay\AppData\Local\Temp\Rtmp6RtCtU/ghitdrat/src/contrib/tabulizer_0.1.24.tar.gz' had status 1
14: In utils::install.packages(to_install, type = type, repos = repos,  ... :
  installation of package ‘tabulizer’ had non-zero exit status
4

1 回答 1

2

大多数问题都是由 R 会话中的 64 位设置造成的。如果你想使用 'tabulizer' 将 R 会话设置为 32 位。如果您正在运行 GUI,则更改其中的设置是最简单的方法。如果您正在使用例如 R-studio,请参阅https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R

在那次运行之后

install.packages("remotes")# 如果没有,请获取包

library(remotes)

remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"), INSTALL_opts = "--no-multiarch", dependencies = c("Depends", "Imports"))

如果这导致错误,请一一安装软件包

install.packages("plyr")# 如果没有,请获取包

library(plyr)

packs <- c('stringi', 'httpuv', 'digest', 'htmltools', 'sourcetools', 'evaluate', 'markdown', 
           'stringr', 'yaml', 'rJava', 'testthat')

laply(packs, function(x){
  install.packages(x)  
  readline(prompt="Press [enter] to continue")
}
  )

如果有错误将它们发布在 Stack 上。如果没有包给出错误(因此按 [enter] 继续),您可以安装 tabulizer

remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"), INSTALL_opts = "--no-multiarch", dependencies = c("Depends", "Imports"))
于 2017-07-27T10:19:17.440 回答