在R中安装tabulizer包

时间:2017-05-10 06:00:39

标签: r package

我使用的是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

1 个答案:

答案 0 :(得分:1)

大多数问题都是由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")#get package如果你没有它

library(remotes)

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

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

install.packages("plyr")#get package如果你没有它

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"))
相关问题