Dynamically select element from a list and work with it - Shiny R

0 votes
I have a list of items and I want to use that list in my Shiny R dashboard. I'm trying to select an element from the list and work with it or apply some function like lm on it. Is that possible?
Dec 5, 2018 in Data Analytics by Ali
• 10,670 points
1,568 views

1 answer to this question.

0 votes

Follow these steps:

  • Import the data into R
  • Check if the list of elements is in fata.frame format, if not convert it into it.
  • To dynamically select elements use selectInput function.
  • To dynamically use the table, use the function renderTable.

Something like this:

ui.R

box(
     selectInput("ip_name", "Select input:", choices = names(l))

server.R

Element <- reactive({
    input$ip_name
  })
 output$table <- renderTable({
      data.frame(l[[input$ip_name]])
    })
answered Dec 5, 2018 by Maverick
• 10,820 points

Related Questions In Data Analytics

0 votes
0 answers

Split a string and store it in multiple columns from a field in R

How to Split a string and store ...READ MORE

Jun 28, 2019 in Data Analytics by Anand
127 views
0 votes
1 answer

How do I remove an element from a list by index in R?

Use list[index] = NULL The list value will ...READ MORE

answered Oct 31, 2019 in Data Analytics by Cherukuri
• 32,460 points
120 views
0 votes
1 answer
0 votes
1 answer

How can I use R to list all files with a specified extension ?

fls <- list.files(pattern = "\\.dbf$") $ at the ...READ MORE

answered May 10, 2018 in Data Analytics by zombie
• 3,750 points
101 views
0 votes
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,820 points
847 views
0 votes
1 answer

Error saying "could not find function dashboardPage" in shiny R

Include this line in the code: Library(shinydashboard) READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,820 points
604 views
+3 votes
3 answers