0

People have been encountering similar issues while trying to install export_png() of ggvis 1, 2, 3, 4, 5. I have followed the instalation of vega through node.js.

here is my code:

library(ggvis) 
mtcars %>% ggvis(~hp, ~mpg, fill=~factor(cyl)) %>% layer_smooths() %>% export_png()

And this is the outcome:

Writing to file plot.png
undefined:3
return x["data"]["domain"];
                ^

TypeError: Cannot read property 'domain' of undefined
    at eval [as get] (eval at <anonymous> (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\node_modules\datalib\src\util.js:147:20), <anonymous>:3:17)
    at eval [as add] (eval at create (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\node_modules\datalib\src\aggregate\measures.js:175:23), <anonymous>:3:14)
    at Facetor.proto._add (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\node_modules\datalib\src\aggregate\aggregator.js:158:31)
    at add (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\src\transforms\Aggregate.js:174:31)
    at Array.forEach (native)
    at Aggregate.prototype.transform (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\src\transforms\Aggregate.js:190:13)
    at Aggregate.prototype.evaluate (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\src\transforms\Transform.js:48:15)
    at Node.dataRef (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\src\scene\Scale.js:387:15)
    at Node.domainMinMax (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\src\scene\Scale.js:429:15)
    at Node.quantitative (C:\Users\mglez\AppData\Roaming\npm\node_modules\vega\src\scene\Scale.js:223:18)
Warning message:
running command '"C:\Users\mglez\AppData\Roaming\npm\vg2png.cmd" C:\Users\mglez\AppData\Local\Temp\RtmpSWJcGx\ggvis25e828cd4fe4/plot.json plot.png' had status 1 

This is my session info

> sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252 LC_NUMERIC=C                          
[5] LC_TIME=English_United States.1252    

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] ggvis_0.4.2

loaded via a namespace (and not attached):
 [1] Rcpp_0.12.5     XML_3.98-1.4    digest_0.6.9    dplyr_0.4.3     assertthat_0.1  mime_0.4        bitops_1.0-6    R6_2.1.2        jsonlite_0.9.22 xtable_1.8-2   
[11] DBI_0.4-1       magrittr_1.5    lazyeval_0.2.0  RJSONIO_1.3-0   tools_3.3.0     RSelenium_1.3.5 RCurl_1.95-4.8  shiny_0.13.2    httpuv_1.3.3    parallel_3.3.0 
[21] caTools_1.17.1  htmltools_0.3.5

Any help will be appreciated.

Community
  • 1
  • 1
Mario GS
  • 859
  • 8
  • 22
  • `This requires that the external program vg2png is installed. This is part of the vega node.js module.` from the documentation on export_png http://rpackages.ianhowson.com/cran/ggvis/man/export_png.html – Cyrus Mohammadian Aug 19 '16 at 00:12
  • also this is a duplicate of http://stackoverflow.com/questions/29411999/install-v2png-program-from-vega-node-js-module-on-windows and http://stackoverflow.com/questions/27674431/exporting-ggvis-plot-with-grouped-data and – Cyrus Mohammadian Aug 19 '16 at 00:13
  • But I have Vega installed the problem seem, something else. – Mario GS Aug 19 '16 at 00:17
  • I would add your `sessionInfo()` – Cyrus Mohammadian Aug 19 '16 at 00:18
  • Thanks, @CyrusMohammadian. It must be something else, because, when vega/v2png is not installed, the error is like this: Error in vega_file(vis, file = file, type = "png") : Conversion program vg2pngnot found. – Mario GS Aug 19 '16 at 00:27
  • @CyrusMohammadian posting links to questions with no answers as duplicate targets is quite useless imo – Jaap Aug 31 '16 at 09:51

0 Answers0