在试图找到这个问题关于保存由d3heatmap生成的热图的解决方案的过程中,我遇到了一个在knitr中使用webshot (HT:hrbrmstr)的无关问题。
library(devtools)
devtools::install_github('yihui/knitr', build_vignettes = TRUE)
library(knitr)在安装和加载knitr的开发版本之后,我尝试运行以下.Rmd文件:
---
title: "Untitled"
output: pdf_document
---
```{r}图书馆(D3heatmap)
D3heatmap(微型车,比例=“列”,颜色=“光谱”)
我被提示安装幻影:
webshot::install_phantomjs()
phantomjs.exe has been installed to /Users/USERNAME/Library/Application Support/PhantomJS我再次尝试运行.Rmd文件,但得到了以下错误:
sh: ~/Library/Application Support/PhantomJS/phantomjs: No such file or directory
Quitting from lines 7-9 (test.Rmd)
Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744, :
webshot.js returned failure value: 127
Calls: <Anonymous> ... html_screenshot -> in_dir -> do.call -> <Anonymous>
Execution halted我相信错误告诉我R找不到phantomjs.exe,但我看到它位于指定的路径上。我知道这是愚蠢的用户错误。
https://stackoverflow.com/questions/36043244
复制相似问题