0

I want to display my existing dataframe in output. In addition to those columns, I need few columns where user input can be recorded. I am able to achieve this through rHandsontable. But, am not able to save the edited/modified table in a dataframe.

Below is the code am using:

    library(shiny)
library(rhandsontable)

mydf<-read.csv('C:/Bhargav/GM/01_Projects/02_Toolkit/04_Validation/Sample_part_number_4.csv')


ui<-fluidPage(
  rHandsontableOutput("df"),
  actionButton("save", "Save table")

)

server<-function(input,output) {

  values <- reactiveValues()

  output$df<-renderRHandsontable({

    DF = data.frame(mydf$PART_NBR,
                    Flag = "Valid/Invalid",
                    reason = "Enter the reason"
    )
    charac = c("Valid","Invalid")
    rhandsontable(DF,width=600, height = 400) %>% hot_col(col = "Flag", type = "dropdown",source=charac) %>% hot_col(col = "reason", allowInvalid = TRUE)

  })


}

runApp(list(ui=ui, server=server))
  • [This](https://antoineguillot.wordpress.com/2017/03/01/three-r-shiny-tricks-to-make-your-shiny-app-shines-33-buttons-to-delete-edit-and-compare-datatable-rows/) might help you – parth Aug 30 '17 at 12:31
  • You can read the modified `rhandsontable` and save it to dataframe using `hot_to_r` function. – SBista Aug 30 '17 at 13:21

0 Answers0