Unable to move table rows in shiny r

0 votes

I have a simple shiny r app. 

library(shiny)
library(DT)
iris2 = head(iris, 30)
server <- function(input, output) {
    output$tb <-DT::renderDataTable(server=FALSE,{
        datatable(
            iris2,
            colnames = c(colnames(iris2)), extensions = 'RowReorder',
            options = list(rowReorder = TRUE))
    })
}
ui <- fluidPage(dataTableOutput('tb', width = '200px', height = '200px'))
shinyApp(ui, server)

But when I try to adjust the table row only the first column changes

Dec 6, 2018 in Data Analytics by Ali
• 11,360 points
781 views

1 answer to this question.

0 votes
Try this:
library(shiny)
library(DT)

iris2 = head(iris, 30)
server <- function(input, output) {
  output$tb <-DT::renderDataTable(server=FALSE,{
    datatable(
      iris2,
      colnames = c(colnames(iris2)), extensions = 'RowReorder',
      options = list(order = list(list(0, 'asc')), rowReorder = TRUE))
  })
}

ui <- fluidPage(dataTableOutput('tb', width = '200px', height = '200px'))

shinyApp(ui, server)
answered Dec 6, 2018 by Maverick
• 10,840 points

Related Questions In Data Analytics

0 votes
1 answer

Unable to install the 'devtools' package in R

Run the below command in your Ubuntu/Linux ...READ MORE

answered Jun 6, 2018 in Data Analytics by Bharani
• 4,660 points
1,474 views
0 votes
1 answer

How to convert a sentence to word table in R?

Try the following code: sentence <- c("case sweden", ...READ MORE

answered Jun 21, 2018 in Data Analytics by Sahiti
• 6,370 points
1,252 views
0 votes
1 answer

How to reduce the height of valueBox in shiny R?

Add this line before using your vlaueBoxes tags$head(tags$style(HTML(".small-box ...READ MORE

answered Dec 4, 2018 in Data Analytics by Haseeb
3,611 views
+1 vote
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,840 points
2,343 views
+1 vote
1 answer

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

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

answered Nov 29, 2018 in Data Analytics by Maverick
• 10,840 points
3,156 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP