Black Lives Matter. Please consider donating to Black Girls Code today.

Exporting PNG files from Plotly in R (on linux)

I have followed this solutions to export a png file from plot_ly in R.

These are working on windows machine :

DF = structure(list(Sector = c("0-N", "1-NNE", "2-ENE", "3-E", "4-ESE", 
"5-SSE", "6-S", "7-SSW", "8-WSW", "9-W", "10-WNW", "11-NNW"), 
    A_parameter = c(4.84, 5.04, 5.05, 4.7, 4.41, 4.66, 5.76, 
    7.44, 6.92, 4.87, 4.39, 4.13), k_Parameter = c(2.24, 2.271, 
    2.115, 1.959, 1.779, 1.943, 2.01, 2.393, 2.326, 1.971, 1.908, 
    1.904), frequency = c(0.057, 0.08, 0.086, 0.071, 0.05, 0.041, 
    0.071, 0.178, 0.182, 0.089, 0.051, 0.045), mean_WS = c(4.287, 
    4.464, 4.473, 4.167, 3.924, 4.132, 5.104, 6.595, 6.131, 4.317, 
    3.895, 3.665)), .Names = c("Sector", "A_parameter", "k_Parameter", 
"frequency", "mean_WS"), row.names = c("3", "4", "5", "6", "7", 
"8", "9", "10", "11", "12", "13", "14"), class = "data.frame")

p <- plot_ly(DF, r = ~(DF$frequency*DF$mean_WS), t = ~DF$Sector) %>% add_area()
export(p, file = "C:/Users/philip/Desktop/dashboard/www/L1.png")

or using :

t=layout(p, radialaxis = list(ticksuffix = "%"), orientation = 270)
saveWidget(plotly::as_widget(t), "C:/Users/philip/Desktop/dashboard/www/temp.html")
 webshot("C:/Users/philip/Desktop/dashboard/www/temp.html", 
                file = "C:/Users/philip/Desktop/dashboard/www/L1.png",
                cliprect = "viewport")

But when I try the same thing on Linux it does not work :

p <- plot_ly(DF, r = ~(DF$frequency*DF$mean_WS), t = ~DF$Sector) %>% add_area()
export(p, file = "/srv/shiny-server/S3/PCE/www/L1.png")

It doesn’t return an error but the png file is blank.
The same results when I try :

t=layout(p, radialaxis = list(ticksuffix = "%"), orientation = 270)
        saveWidget(plotly::as_widget(t), "/srv/shiny-server/S3/PCE/www/temp.html")
        webshot("/srv/shiny-server/S3/PCE/www/temp.html", 
                file = "/srv/shiny-server/S3/PCE/www/L1.png",
                cliprect = "viewport")

Do I miss something?