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 5, 2018 in Data Analytics by Ali
• 10,290 points
25 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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 5, 2018 by Maverick
• 10,000 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,550 points
393 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 darklord
• 6,140 points
15 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
129 views
0 votes
1 answer

How to add videos in a shiny R dashboard?

Its pretty simple, try this: server.r library(shiny) shinyServer(function(input, output, session) ...READ MORE

answered Dec 4, 2018 in Data Analytics by Haseeb
43 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,000 points
232 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,000 points
129 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.