Plz, help me! How can I integrate the 1st code to the 2nd one in the following example? As a result I want it to run in shiny and display as a data table.
#The 1st code snippet:
data_table <- data.table(
"No" = c(1, 2, 3, 4, 5),
"Date" = as.Date(c("2021-01-01", "2021-01-02", "2021-01-03", "2021-01-04", "2021-01-05")),
"Primary_Document_Number" = c("A001", "A002", "A003", "A004", "A005"),
)
#The 2nd code snippet:
Accounting <- list(
Short_Term_Assets = list(
name = "Short Term Assets",
items = list(
Cash = list(
name = "Cash",
items = list(
Cash_in_account = list(name = "Cash in account")
)
)
)
)
)
ui <- fluidPage(
br(),
NestedMenuOutput("menu", height = "auto"),
br(),
dataTableOutput("clicked")
)
server <- function(input, output, session) {
output[["menu"]] <- renderNestedMenu({
NestedMenu(
"Accounting",
items = Accounting
)
})
output[["clicked"]] <- renderDataTable({
input[["menu"]]
})
}