I have one plotly plot and I want to display plot on other UI such as angular, using R Plumber.
Asked
Active
Viewed 990 times
1 Answers
5
Here is how you do it:
# API for experimenting with html widgets
library(plumber)
library(ggplot2)
library(plotly)
#* @apiTitle HTML widgets API
#* Return interactive plot using plotly
#* @serializer htmlwidget
#* @get /plotly
function() {
p <- ggplot(data = diamonds,
aes(x = cut, fill = clarity)) +
geom_bar(position = "dodge")
ggplotly(p)
}
Hope this helps.
Source - https://github.com/blairj09/plumber-playground/blob/master/experiments/htmlwidgets-exp/plumber.R

Abhishek R
- 4,087
- 1
- 17
- 21