r-wasm / webr

The statistical language R compiled to WebAssembly via Emscripten, for use in web browsers and Node.
https://docs.r-wasm.org/webr/latest/
Other
805 stars 54 forks source link

Could not load dynamic lib: /usr/lib/R/library/png/libs/png.so #357

Open gorkang opened 5 months ago

gorkang commented 5 months ago

Hi! Trying out webr with the package BayesianReasoning. When creating a plot, I get an error that seems related to png.

The only missing dependency in https://repo.r-wasm.org/ for BayesianReasoning is curl, but curl is only used in a vignette.


  ---
  title: "webR test"
  filters:
    - "webr"
  ---

  ```{webr-r}

  webr::install("BayesianReasoning")

  BayesianReasoning::PPV_heatmap(Sensitivity = 90, limits_Specificity = c(90, 100))

Error: unable to load shared object '/usr/lib/R/library/png/libs/png.so': Could not load dynamic lib: /usr/lib/R/library/png/libs/png.so LinkError: imported function 'env.R_registerRoutines' signature mismatch

No idea but maybe is related to this? https://stackoverflow.com/a/50935430/1873521 It seems png may need libpng16-16 on ubuntu and similar systems.

Thanks for the amazing work.

gorkang commented 5 months ago

Also, not sure if related, if I install ggplot2 and png, I get an error when printing ggplots. The same code commenting the -"png" line works fine:

---
title: "webR test"
filters:
  - "webr"
webr:
  packages:
  - "ggplot2"
  - "png"
---

Test:  

```{webr-r}

mpg |> 
  ggplot2::ggplot(aes(hwy, cty)) +
  ggplot2::geom_point() +
  ggplot2::theme_minimal()

Error: Problem while converting geom to grob.