Display Value instantly in Datatable when radio button is clicked

In the below attached image, the output is Shiny data table output , here i need to change the value of " cat" when the radio button is changed from Yes to No . Please help while providing your valuable suggestions.

Capture

You will greatly increase your chances of a helpful reply if you provide a minimal reprex, or reproducible example, that lays out the basic structure of your problem so that people can see what you've already attempted. You can learn more about how to create a reprex for shiny apps at https://mastering-shiny.org/introduction.html#reprex

#Libraries
library(shiny)
library(shinydashboard)
library(highcharter)
library(purrr)
library(dplyr)
library(shinyWidgets)
library(DT)
library(shinyBS)

tabledata1 <- data.frame(country = c("Australia","Australia","Australia","Australia","Australia"), Code =c("Rahil","Rahil","Rahil","Rahil","Rahil") ,cat = c(1,1,1,1,1))
un_sq <- unique(tabledata1$Code)
tempa <- list()

ui <- dashboardPage(
  dashboardHeader(title = "Data Updation with collapsibility functionality" , disable = FALSE),
  dashboardSidebar(),
  dashboardBody(
    
    fluidRow(
      box(
        title = "Table Structure", status = "primary", solidHeader = TRUE,
        collapsible = TRUE,width = 12,uiOutput("Works")
      )
    )
)
)
server <- function(input,output,session){
  output$Works <- renderUI({
       lapply( 1:length(un_sq),function(i) {
      bsCollapse(id = "collapseExample",
                 bsCollapsePanel(un_sq[i],  dataTableOutput(paste("mytable", i , sep ="")), style = "primary")
      ) 
      
    }
    )})

    
    shinyValue = function(id, len) { 
      unlist(lapply(seq_len(len), function(i) { 
        value = input[[paste0(id, i)]] 
        if (is.null(value)) NA else value 
      })) 
    }
    Rahil = function(FUN, len, id, ...) { 
      inputs = character(len) 
      for (i in seq_len(len)) { 
        inputs[i] = as.character(FUN(paste0(id, i), label = NULL, ...)) 
      } 
      inputs 
    } 
  th <- function(){

     for(i in 1:nrow(tabledata1)){
        
        tempa[[i]]=data.frame(tabledata1[i,],Answer=   Rahil(radioButtons , nrow(tabledata1[i,]),paste0("radio" , i),selected ="yes" ,
                                                              choices =c("yes", "no"), inline= T),OP =  tabledata1$cat[i])
        
     }
   return(do.call(rbind,tempa))
 
   
  }
  
 
   rea1 <- reactiveValues(df = th()
                          )
 rea2<- reactive({rea1$df})
   
 observeEvent(input$radio11,{
  
   if(rea1$df$cat[1] == 1){
     rea1$df$cat[1] =2
     print(rea1$df$cat[1])
   }else{
     rea1$df$cat[1]=1
     print(rea1$df$cat[1])
   }
   rea2()
   
   
 })   
   
    
  
  output$mytable1 = DT::renderDataTable({rea2()},selection='none',server = FALSE, escape = FALSE,class = 'cell-border stripe', options = list(columnDefs = list(list(width = '600px', targets = 2),list(visible=FALSE)), ordering=F,pageLength = 10000,   lengthMenu = c(5, 10, 20, 100, 1000, 10000) , dom ="t",
                                                                                                                                            preDrawCallback = JS('function() { 
                                                                                                                                                                 Shiny.unbindAll(this.api().table().node()); }'), 
                                                                                                                                            drawCallback = JS('function() { 
                                                                                                                                                              Shiny.bindAll(this.api().table().node()); } ')))
  
}


shinyApp(ui, server)

That's a great start. Now work on making it smaller so it illustrates the exact problem you are having. For example, you currently load eight packages: are they all actually necessary?

library(shiny)
library(shinydashboard)
library(highcharter)
library(purrr)
library(dplyr)
library(shinyWidgets)
library(DT)
library(shinyBS)

I would also recommend applying a consistent style (perhaps using the styler package) so it is more clear how your code is nested.