【问题标题】:Problem with saving kable table (install_phantomjs)保存 kable 表的问题 (install_phantomjs)
【发布时间】:2021-06-14 18:00:07
【问题描述】:

让我们考虑kable创建的非常简单的表

library(knitr)
library(kableExtra)

x <- data.frame(1:3, 2:4, 3:5)
x <- kable(x, format = "pipe", col.names = c("X_1", "X_2", "X_3"), caption = "My_table") 

我想将此表保存为 .pdf 格式

x %&gt;% save_kable("My_table.pdf")

但我得到错误:

PhantomJS not found. You can install it with webshot::install_phantomjs(). If it is installed, please make sure the phantomjs executable can be found via the PATH variable.

但是,当尝试通过建议的命令安装它时:

webshot::install_phantomjs()

我得到错误:

Error in utils::download.file(url, method = method, ...) : 
  cannot open URL 'https://github.com/wch/webshot/releases/download/v0.3.1/phantomjs-2.1.1-windows.zip'

所以我的问题是 - 有没有可能在不使用 phanomjs 的情况下保存 kable 表?

【问题讨论】:

    标签: r save knitr kable


    【解决方案1】:

    该命令适用于我,并且 URL 也可用。

    我怀疑该文件(它是一个.zip 文件)被您的防火墙或防病毒软件阻止。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-09-11
      • 1970-01-01
      • 1970-01-01
      • 2023-03-12
      • 2021-06-14
      • 1970-01-01
      • 2020-04-08
      相关资源
      最近更新 更多