plotly / plotly/plotly.R

render ggplotly graphic - unable to start device

Aperta
#2,347 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Lingua principale
R
Stelle
2.7k
Fork
641
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Hello,

I try to plot dynamic graphs in a simple dashboard page, here a simple example:

ui.r part

library(shiny)
library(ggplot2)
library(plotly)
library(shinydashboard)

ui <- dashboardPage(
  dashboardHeader(title = "Basic dashboard"),
  dashboardSidebar(),
  dashboardBody(
    fluidRow(
	  plotlyOutput("plot3")
)
)
)

and server.r part

server <- function(input, output) { 
  output$plot3 <- renderPlotly({

  g <- ggplot(faithful, aes(x = eruptions, y = waiting)) +
  stat_density_2d(aes(fill = ..level..), geom = "polygon") + 
  xlim(1, 6) + ylim(40, 100)
  ggplotly(g)
  })
}

This app renders an error : unable to start PNG device.
Do you think is it a problem with my R session and versions of packages ?

R version 4.1.2 (2021-11-01)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 22.04.4 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas-pthread/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so

locale:
[1] LC_CTYPE=C.UTF-8 LC_NUMERIC=C LC_TIME=C.UTF-8
[4] LC_COLLATE=C.UTF-8 LC_MONETARY=C.UTF-8 LC_MESSAGES=C.UTF-8
[7] LC_PAPER=C.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C

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

other attached packages:
[1] maptiles_0.7.0 sf_1.0-8

loaded via a namespace (and not attached):
[1] Rcpp_1.0.10 magrittr_2.0.3 units_0.8-0 tidyselect_1.2.0
[5] R6_2.5.1 rlang_1.1.1 fansi_1.0.4 dplyr_1.1.2
[9] tools_4.1.2 grid_4.1.2 KernSmooth_2.23-20 utf8_1.2.3
[13] terra_1.6-17 cli_3.6.1 e1071_1.7-12 DBI_1.1.3
[17] class_7.3-20 tibble_3.2.1 lifecycle_1.0.3 codetools_0.2-18
[21] vctrs_0.6.3 glue_1.6.2 proxy_0.4-27 compiler_4.1.2
[25] pillar_1.9.0 generics_0.1.3 classInt_0.4-8 pkgconfig_2.0.3

Many thanks,

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Riproducete l’esempio minimo Shiny utilizzando gli snippet ui.r e server.r, concentrandovi su renderPlotly, ggplotly e stat_density_2d. Verificate l’ambiente segnalato con R 4.1.2 e Ubuntu 22.04.4 e l’errore del dispositivo PNG; l’issue è risolta quando viene identificata la causa e l’esempio viene renderizzato senza tale errore.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
r
Ambito
data-visualization
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.