简体   繁体   English

在 R 中安装 tabulizer 包

[英]Installing tabulizer package in R

I am using R version 3.4.0.我正在使用 R 版本 3.4.0。 My PC is 64 bit windows 10.我的电脑是 64 位 Windows 10。

I wanted to extract dataframes from PDF documents in R.我想从 R 中的 PDF 文档中提取数据框。

I tried to install tabulizer package using github but i am getting the following error.我尝试使用 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’

The warnings were as follows,警告如下,

> 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

Most of the problems are cost by the 64 bit setting in your R session.大多数问题都是由 R 会话中的 64 位设置造成的。 If you want to use 'tabulizer' set the R session to 32 bit.如果您想使用“tabulizer”,请将 R 会话设置为 32 位。 If you are running a GUI, change the setting in there is the easiest way.如果您正在运行 GUI,更改其中的设置是最简单的方法。 If you are using eg R-studio see https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R .如果您正在使用 R-studio,请参阅https://support.rstudio.com/hc/en-us/articles/200486138-Using-Different-Versions-of-R

After that run在那之后运行

install.packages("remotes") # get Package if you don't have it install.packages("remotes") # 如果没有包,请获取

library(remotes)

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

If this results in errors install the packages one by one如果这导致错误,请一一安装软件包

install.packages("plyr") # get Package if you don't have it 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")
}
  )

If there are errors post them on Stack.如果有错误,请在 Stack 上发布。 If none of the packs gives an error (therefore the Press [enter] to continue), you can install tabulizer with如果没有任何包出错(因此按 [enter] 继续),您可以安装 tabulizer

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM