0

I have a blog that uses Netlify. So, if I want to embed an interactive element, I believe I need to use an iframe.

The interactive element I wish to use is a simple image carousel.

library("slickR")

img <- c("img1.png",
         "img2.png", 
         "img3.png",
         "img4.png")

slickR(obj = img, slideId = 'ex1', height = 675, width = 540)

To create a stand alone page that just contains an image carousel do I need to use shiny-server to convert the R into css, HTML, Javascript?

If so, here's my attempt. Please advise as to what is wrong.

library(shiny)
library(htmlwidgets)
library(slickR)

ui = fluidPage(
  htmlwidgets::shinyWidgetOutput(outputId = , "carousel",
                                 name = "img_carousel",
                                 width = "550px", 
                                 height = "600px")
)

server = function(input, output) {
  img <- c("img1.png",
           "img2.png",
           "img3.png",
           "img4.png")

  slickR_obj <- slickR(obj = img, slideId = 'ex1', width = 540, height = 675)

  output$carousel <- htmlwidgets::shinyRenderWidget(slickR_obj)
}

shinyApp(ui = ui, server = server)
ixodid
  • 2,180
  • 1
  • 19
  • 46

1 Answers1

1

Shiny server is required for shiny apps. What you wrote is a shiny app. But you can easily convert it to an rmarkdown document or flexdahsboard, which WILL be just html that can render anywhere. If you aren't familiar with either of these, they're both rstudio packages for creating html reports in R.

DeanAttali
  • 25,268
  • 10
  • 92
  • 118