sagemathinc / cocalc

CoCalc: Collaborative Calculation in the Cloud
https://CoCalc.com
Other
1.17k stars 216 forks source link

rmd pdf output fails with data.tree example #5773

Open DrXyzzy opened 2 years ago

DrXyzzy commented 2 years ago
  1. Enter the following example program for data.tree in R:

    output: pdf_document

    library(data.tree)
    
    acme <- Node$new("Acme Inc.")
      accounting <- acme$AddChild("Accounting")
        software <- accounting$AddChild("New Software")
        standards <- accounting$AddChild("New Accounting Standards")
      research <- acme$AddChild("Research")
        newProductLine <- research$AddChild("New Product Line")
        newLabs <- research$AddChild("New Labs")
      it <- acme$AddChild("IT")
        outsource <- it$AddChild("Outsource")
        agile <- it$AddChild("Go agile")
        goToR <- it$AddChild("Switch to R")
    
    plot(acme)
  2. No output is produced and log shows (or other error):
    processing file: dtree2.rmd
    Quitting from lines 6-21 (dtree2.rmd)
    Error in (function (url = NULL, file = "webshot.png", vwidth = 992, vheight = 744,  :
      webshot.js returned failure value: -6
    Calls:  ... html_screenshot -> in_dir -> do.call -> 
    Execution halted
    
  3. Change output format in prologue to "html_output" and html output tab shows correct output. r-data-tree

Reported by Chad Worley.

haraldschilly commented 2 years ago

Hmm, interesting. Well, this could be really hard to fix, because it's maybe an upstream issue. In any case, good to know it works one way but not the PDF way.

DrXyzzy commented 2 years ago

And FWIW the jupyter notebook version works.

r-data-tree-nb