【发布时间】: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 %>% 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 表?
【问题讨论】: