Entering edit mode
4.3 years ago
gubrins
▴
350
Heys, I'm trying to save as a html file an output from ggplotly in R and I'm getting all the time this error:
Error in FUN(X[[i]], ...) :subscript out of bounds
The code of my plot is quite simple:
b <- ggplot(pca, aes(PC1, PC2, label=ind, col=col,labels=ID))+ geom_point(size = 2)
And the problem appears when I try to save it as an html file:
htmlwidgets::saveWidget(as_widget(b), "index.html")
Any idea of how can I fix that? Thanks in advance!
If you are using Rstudio, Viewer window allows you to export the graphical output from plotly/ggplotly as html (Viewer > export > save as web page).
Try this:
Thanks for your answer, at the end I solved it in a similar way, creating an Rmarkdown html file