1

I have pinned a list of datasets on Rstudio connect. (there are about 100 datasets in the list) I am trying to create a shiny app that will use the datasets from the pin based on the user input.

Is it possible to pin_get part of the list ?

To add an example here is what I am trying to do

# Create board
board_register("rsconnect", 
                server = MY_SERVER,
                key = MY_KEY,)

# Create list of dataframes
dflist <- lapply(1:10, function(x) {mtcars})

# Pin dflist to your board
pin(dflist , "Pinned_dflist", board = "rsconnect")

#Get dflist back in another document 
dfs<- pin_get("Pinned_dflist", board = "rsconnect")

# Keep only needed dataframe in shiny

ui <- fluidPage(
  sidebarLayout(
    sidebarPanel(
      selectInput(
        inputId = "df_num",
        label = "Select dfnumber",
        choices = seq(1:10),
        multiple = FALSE
      )
    )
    mainPanel(
       plotOutput("plot")
    )
  )
server <- function(input, output, ...) {
    
    output$plot <- renderPlot({
      plot(dfs[[input$df_num]])
    })

     
ok1more
  • 779
  • 6
  • 15
  • I have RSC and know of the presence of pins but have not attempted yet to integrate them into anything. Do you have a [mcve] that can walk through how you're using it and what you'd like to do? – r2evans Nov 10 '21 at 15:19
  • 1
    @r2evans added an example – ok1more Nov 10 '21 at 16:01

0 Answers0