in Education by
I am building a Shiny app with a Leaflet map based on a PostgreSQL spatialdatabase. I succeeded to import spatial data into SpatialPolygonDataFrame and to display it on Leaflet widget. I am trying to display the data from the SpatialDataFrame with a RenderTable output, but its not working, even by converting it with as.data.frame(spatialdataframe). Therefore this conversion is enough to dispay the table with view(), kable() or other display functions, but not in Shiny. Should I make another conversion? Anyone got an idea? ui <- fluidPage( titlePanel("AgriPAG"), sidebarLayout( mainPanel( tabsetPanel( tabPanel(leafletOutput("m",width = "100%", height = 1000)), tabPanel(tableOutput(as.data.frame(sample_test1))) ) ), sidebarPanel("curseur") ) ) server <- function(input,output, session){ data <- reactive({ x <- test1 }) output$mymap <- renderLeaflet({ test1 <- data() m <- leaflet(data = sample_test1) %>% addTiles() %>% setView(lng=-52.3333300, lat=4.9333300 , zoom=10) %>% addPolygons(data=sample_test1, weight=2, col="black", opacity=0.5) m }) output$table <- renderDataTable(as.data.frame(sample_test1)) } shinyApp(ui = ui, server = server) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
renderDataTable does not work with tableOutput. You have to use dataTableOutput instead. In addition, you should add the correct inputId for dataTableOutput. To get everything to work change: tableOutput(as.data.frame(sample_test1)) in your ui to dataTableOutput('table')

Related questions

0 votes
    How to display the content of the DataFrame 1. df.view() 2. df.list() 3. None of the options 4. df.show()...
asked Oct 22, 2020 in Technology by JackTerrance
0 votes
    How to replace the values of NA with zeros in some column and data frame I have? Select the correct answer from above options...
asked Jan 20, 2022 in Education by JackTerrance
0 votes
    How to replace the values of NA with zeros in some column and data frame I have? Select the correct ... Questions, Core Hadoop MCQ,core Hadoop interview questions for experienced...
asked Oct 30, 2021 in Education by JackTerrance
0 votes
    I've been trying to implement a spatial partitioning algorithm in my game, but both spatial hashes and ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 24, 2022 in Education by JackTerrance
0 votes
    ______ Uses Grieg-Smith method on 2 dimensional spatial data. (a) G.S. (b) g.data (c) G1DBN (d) ... Linear Regression of R Programming Select the correct answer from above options...
asked Feb 12, 2022 in Education by JackTerrance
0 votes
    I want to exclude specific participants from a DataFrame and create it from an existing DataFrame. I want a method ... worked for me. Select the correct answer from above options...
asked Jan 23, 2022 in Education by JackTerrance
0 votes
    Which of the following can be used to display the names of (most of) the objects which are currently stored ... of R Programming Select the correct answer from above options...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    How many components are involved in shiny? (a) 3 (b) 4 (c) 5 (d) none of the mentioned ... programming questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    here's my problem. I access Google Analytics API via R with googleAnalyticsR. The whole thing happens in a ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Apr 23, 2022 in Education by JackTerrance
0 votes
    Which of the following statement will install shiny? (a) install.packages( shiny ) (b) install.library( ... and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    runApp() will run the shiny and open the browser window. (a) True (b) False I had been asked ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Which of the following can be done by shiny? (a) Tabbed main panels (b) Editable data tables (c) ... questions and answers pdf, Data Science interview questions for beginners...
asked Oct 28, 2021 in Education by JackTerrance
0 votes
    Point out the correct statement. (a) shiny project is a directory containing at least three parts (b) shiny project ... directory containing only one part (d) none of the mentioned...
asked Oct 9, 2021 in Technology by JackTerrance
0 votes
    runApp() will run the shiny and open the browser window. (a) True (b) False...
asked Oct 5, 2021 in Technology by JackTerrance
0 votes
    Which of the following can be done by shiny? (a) Tabbed main panels (b) Editable data tables (c) Dynamic UI (d) All of the mentioned...
asked Oct 5, 2021 in Technology by JackTerrance
...