Reactive table shiny - shiny

I want to make a shiny app that show a table depends the parameters enter
tabla4<- reactive({
tabla<-activos_vabs[activos_vabs$Comunidades==input$com4 & activos_vabs$Sexo==input$sexo4 & activos_vabs$Edad==input$edad4, ];
return(tabla);
})
I have this and it doesn't show anything , but if i give the values, not with the input its works
tabla4<- reactive({
tabla<-activos_vabs[activos_vabs$Comunidades=="Total Nacional" & activos_vabs$Sexo=="Ambos sexos" & activos_vabs$Edad=="Total", ];
return(tabla);
return(prueba[5])
})
I have a big table, and i just want to print a part .

The below sample shiny code will solve your requirement.
library(shiny)
ui <- fluidPage(selectInput(inputId = "selectedName", label = "Select a name",
choices = levels(data$name)),
tableOutput("table")
)
server <- function(input, output, session){
df <- reactive({data.frame(data[data$name == input$selectedName,])
})
output$table <- renderTable( df() )
}
shinyApp(ui = ui, server = server)
data used in code is below.
dput(data)
structure(list(name = structure(c(1L, 2L, 6L, 5L, 4L, 3L, 1L,
1L, 1L, 2L, 2L, 2L, 5L, 5L, 5L), .Label = c("aaa", "ddd", "eee",
"ggg", "ppp", "yyy"), class = "factor"), test = c(14, 88, 36,
25, 56, 34, 30, 75, 44, 19, 83, 49, 87, 62, 50), result = c(25,
44, 39, 88, 10, 44, 58, 22, 94, 56, 73, 15, 84, 223, 45)), .Names = c("name",
"test", "result"), row.names = c(NA, -15L), class = "data.frame")
Filtering of dataframe depends on the selection we make in selectInput dropdown.

Related

Shiny tabPanel datatable including filter options

I have created a tabPanel and want to give the chance to filter by different variables (e.g., show All, gender (male or female), gaming frequency (never, sometimes, often). Giving a filter possibility on the right side of the table.
The tabPanel alone is working fine, however, I do not know how to add the select Input filter (a) multiple variables as well as b) used the output$data for output$mytable.
Gender <- c(2, 2, 2, 1, 2, 2, 1, 1, 1, 2, 2, 1, 2, 1, 1, 1, 2, 1, 2, 1) # 1 male, 2 female
Gaming_freq <- c(2, 3, 3, 3, 6, 4, 5, 5, 3, 5, 6, 5, 3, 3, 3, 2, 5, 6, 6, 3) # 2 = less than once a month, 3= once a month, 4 = once a week, 5 = more than once a week, 6 = daily
color_white <- c(0.14939, -0.40033, 0.638, -0.40328, -0.5725, 0.77422, 0.47419, -0.14982, 0.61388, 0.29264, 1.63992, 1.69396, -0.76722, 0.2279, 1.8937, 1.05535, -0.02912, -0.98787, -0.08184, 0.02536)
color_black_red <- c(-0.22686, 1.0993, 1.31564, 1.79799, 0.58323, -0.20128, 0.28315, 0.65687, -0.28894, 1.03393, 0.19963, -0.14561, 0.889, 1.5685, 0.15463, 0.74984, 0.42837, 1.31831, 0.82064, 1.13308)
color_black_blue <- c(-0.19905, -0.12332, -0.3628, 0.04108, -0.51553, -0.74827, -0.73246, -1.15794, -1.05443, -0.79687, -0.43895, -0.48986, -0.25574, -1.55343, -0.52319, -0.31203, -0.62926, -1.0094, -0.11217, -0.76892)
Controller_none <- c(-0.83456, -2.1176, -2.09919, -2.30543, -1.8594, -1.83014, -2.67447, -2.25647, -0.33004, 1.04676, -0.0674, -1.22428, -0.61644, -2.49707, 0.1737, -1.38711, -0.86417, -0.9775, -0.86747, -0.13341)
Controller_white <- c(0.51451, 0.49362, 1.17843, -0.03151, 1.27484, 0.74152, 0.07918, 1.18577, 0.50183, -0.1483, 0.22328, 1.1426, 0.46526, 1.94735, -0.60943, 1.02407, 0.55938, 1.10468, -0.12908, -0.00329)
Controller_red <- c(0.93577, 1.92379, 0.8746, 1.02084, 1.08547, 0.74312, 1.53032, 0.74821, -0.10777, 0.48774, 0.29206, 0.09947, 0.21528, 1.41961, 1.59125, -0.21777, 0.56455, 0.83702, 1.2306, 0.51277)
All <- rep(1, 20)
d <- as.data.frame(cbind(Gender, Gaming_freq, color_white, color_black_red, color_black_blue, Controller_none, Controller_white, Controller_red, All))
library(shiny)
library(shinythemes)
library(shinydashboard)
ui <- fluidPage(theme = shinytheme("sandstone"),
dashboardPage(skin = "red",
header = dashboardHeader(title = "Dashboard of Survey Results"),
sidebar = dashboardSidebar(
sidebarMenu(
menuItem("Overview", tabName = "overview", icon = icon("dashboard")),
menuItem("Utilities", icon = icon("th"), tabName = "utilities"),
menuItem("Importances", icon = icon("th"), tabName = "importances")
)
),
body = dashboardBody(tabItems(
tabItem(tabName = "utilities",
h2("Utilities of attribute levels"),
mainPanel(
tabsetPanel(
id = 'dataset',
tabPanel("Color", DT::dataTableOutput("mytable1")),
tabPanel("Extra Controller", DT::dataTableOutput("mytable2"))
)
)),
tabItem(tabName = "importances",
h2("Importance for attributes")
))))
)
server <- function(input, output) {
output$mytable1 <- DT::renderDataTable({
DT::datatable(round(d[,3:5], digits = 3), options = list(lengthMenu = c(5, 30, 50, 90), pageLength = 10, bFilter=0))
})
output$mytable2 <- DT::renderDataTable({
DT::datatable(round(d[,6:8], digits = 3),options = list(lengthMenu = c(5, 30, 50, 90), pageLength = 10, bFilter=0))
})
}
shinyApp(ui = ui, server = server)
Thanks in advance.
You can filter your data and wrap it in a reactive element, so you can later use it for any subsequent output plots/tables. You can read more about working with reactive expressions on Rstudio website.
Here as a demo, I get an input on the 'Gender', for further filtering the data out (I've used radio buttons but you can use your widget of choice: slider, select button, etc.)
radioButtons("gender", "filter for gender",
choices = c("One" = '1',
"Two" = '2')),
Then in the server, I use this input to filter the data based on the gender, and wrap it up in a reactive element:
filteredData <- reactive({
tempDataTable <- d %>% dplyr::filter(Gender==input$gender)
tempDataTable
})
Next you can use this reactive element containing your filtered data for generating output tables:
output$mytable1 <- DT::renderDataTable({
d <- filteredData()
DT::datatable(round(d[,3:5], digits = 3), options = list(lengthMenu = c(5, 30, 50, 90), pageLength = 10, bFilter=0))
})
You can use similar strategy to add additional filters or features, find the entire demo ui+server code here:
library(shiny)
library(shinythemes)
library(shinydashboard)
library(tidyverse)
library(DT)
ui <- fluidPage(theme = shinytheme("sandstone"),
dashboardPage(skin = "red",
header = dashboardHeader(title = "Dashboard of Survey Results"),
sidebar = dashboardSidebar(
sidebarMenu(
menuItem("Overview", tabName = "overview", icon = icon("dashboard")),
menuItem("Utilities", icon = icon("th"), tabName = "utilities"),
menuItem("Importances", icon = icon("th"), tabName = "importances")
)
),
body = dashboardBody(tabItems(
tabItem(tabName = "utilities",
h2("Utilities of attribute levels"),
mainPanel(
radioButtons("gender", "filter for gender",
choices = c("One" = '1',
"Two" = '2')),
tabsetPanel(
id = 'dataset',
tabPanel("Color", DT::dataTableOutput("mytable1")),
tabPanel("Extra Controller", DT::dataTableOutput("mytable2"))
)
)),
tabItem(tabName = "importances",
h2("Importance for attributes")
))))
)
server <- function(input, output) {
filteredData <- reactive({
tempDataTable <- d %>% dplyr::filter(Gender==input$gender)
tempDataTable
})
output$mytable1 <- DT::renderDataTable({
d <- filteredData()
DT::datatable(round(d[,3:5], digits = 3), options = list(lengthMenu = c(5, 30, 50, 90), pageLength = 10, bFilter=0))
})
output$mytable2 <- DT::renderDataTable({
d <- filteredData()
DT::datatable(round(d[,6:8], digits = 3),options = list(lengthMenu = c(5, 30, 50, 90), pageLength = 10, bFilter=0))
})
}
shinyApp(ui = ui, server = server)

Errors when trying to apply conditional filters

I have the following data for which I am trying to make a set of dropdown filters that will alter the displayed dataframe according to what was selected in the filters:
myData<- structure(list(waterbody = c("Homer", "Homer", "Homer", "Homer",
"West", "West", "West", "East", "East", "East", "East", "Walnut",
"Walnut", "Walnut", "Walnut"), transect_number = c(1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), species = c("LMB",
"LMB", "GZS", "BLG", "LMB", "GZS", "BLG", "BLG", "BLG", "GZS",
"BLG", "BLG", "LMB", "GZS", "LMB"), length_mm = c(430L, 430L,
NA, 165L, 345L, NA, 128L, 117L, 93L, NA, 135L, 161L, 402L, NA,
347L), wt_g = c(1270L, 1325L, NA, 108L, 545L, NA, 40L, 28L, 15L,
NA, 42L, 81L, 865L, NA, 525L)), row.names = c(NA, -15L), class = "data.frame")
Additionally, the options in each subsequent filter should change depending on what was selected in the previous one. So the species availbale to select would change depending on what waterbodies are selected (because not all of them occur in each water).
My code so far:
# User Interface
ui <- shinyUI(
fluidPage(
titlePanel("File Inputs"),
sidebarLayout(
sidebarPanel(
fileInput(
'data',
'Choose CSV File',
accept = c('text/csv',
'text/comma-separated-values,text/plain',
'.csv')
),
uiOutput("pick_waterbody"),
uiOutput("pick_species")
),
mainPanel(DT::dataTableOutput('dt_table'),)
)
)
)
# Server
server <- function(input, output, session) {
myData <- reactive({
inFile <- input$data
if (is.null(inFile))
return(NULL)
data <- read.csv(inFile$datapath, header = T)
data
})
output$dt_table <- DT::renderDataTable({
DT::datatable(myData())
})
output$pick_waterbody <- rednderUI({
pickerInput(
"pick_waterbody",
"Water(s) of Interest:",
choices = unique(myData$waterbody),
options = list(`actions-box` = TRUE),
)}
)
output$pick_species <- renderUI({
updatePickerInput(
"pick_species",
"Species of Interest:",
choices = as.character(myData[myData$waterbody == input$pick_waterbody, "species"]),
options = list(`actions-box` = TRUE))
})
}
When closing the server code after the output$dt_table, the app works fine. But when I include the output$pick_waterbody code I get a "could not find function renderUI" error. Additionally, the output$pick_species code says there are unexpected symbols found. I've combed through it what feels like 1,000 times and I can't seem to figure out these issues.
Would very much appreciate some help in figuring out where I'm going wrong.
You had a typo, needed req(), and not updatePickerInput() just pickerInput. Try this
output$pick_waterbody <- renderUI({
req(myData())
pickerInput(
"pick_waterbody",
"Water(s) of Interest:",
choices = unique(myData()$waterbody),
options = list(`actions-box` = TRUE),
)}
)
output$pick_species <- renderUI({
req(myData(),input$pick_waterbody)
pickerInput(
"pick_species",
"Species of Interest:",
choices = as.character(myData()[myData()$waterbody == input$pick_waterbody, "species"]),
options = list(`actions-box` = TRUE))
})

Is it possible to filter a simple feature (sf) object using selectizeGroupUI in R shiny?

I'm trying to build a Shiny app containing a leaflet map showing movement paths, that can be bidirectionally filtered using two other columns in the dataset which contains the geometry data.
To do so, I'm trying to use selectizeGroupUI (shinyWidgets package), which allows bidirectional/mutually dependent filtering.
However, when I run the code I get the following error:
"Warning: Error in polygonData.default: Don't know how to get path
data from object of class data.frame"
I have a feeling that this is because mapping path (linestring) data in a leaflet map requires the underlying dataset to be an sf object, whereas selectizeGroupUI converts the sf object into a data.table(?), hence the error message.
This is supported by the fact that when I convert the dataset from sf object to data.table and try to plot the paths as individual A and B coordinates (without a connecting line), the whole thing works perfectly.
Any idea whether there exists a work around?
Any help would be hugely appreciated, please and thanks!
A reprex:
library(tidyverse)
library(sf)
library(shiny)
library(shinyWidgets)
# generate the table with geometry data
geo_data <- structure(list(idx = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
start_lat = c(33.40693,33.64672, 33.57127, 33.42848, 33.54936, 33.53418, 33.60399, 33.49554,33.5056, 33.61696),
start_long = c(-112.0298, -111.9255, -112.049,-112.0998, -112.0912, -112.0911, -111.9273, -111.9687, -112.0563, -111.9866),
end_lat = c(33.40687, 33.64776, 33.57125, 33.42853,33.54893, 33.53488, 33.60401, 33.49647, 33.5056, 33.61654),
end_long = c(-112.0343,-111.9303, -112.0481, -112.0993, -112.0912, -112.0911, -111.931,-111.9711, -112.0541, -111.986)),
row.names = c(NA, -10L), spec = structure(list(cols = list(idx = structure(list(), class = c("collector_double","collector")),
start_lat = structure(list(), class = c("collector_double", "collector")),
start_long = structure(list(), class = c("collector_double", "collector")),
end_lat = structure(list(), class = c("collector_double", "collector")),
end_long = structure(list(), class = c("collector_double","collector"))),
default = structure(list(), class = c("collector_guess","collector")), delim = ","),
class = "col_spec"),class = c("data.table","data.frame"))
geo_data<- setDT(geo_data)
geo_data <- geo_data[
, {
geometry <- sf::st_linestring(x = matrix(c(start_lat, start_long, end_long, end_long), ncol = 2, byrow = T))
geometry <- sf::st_sfc(geometry)
geometry <- sf::st_sf(geometry = geometry)
}
, by = idx
]
# generate the table with columns to filter the geometry data, join with geometry data and convert to sf
table <- structure(list(idx = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
column1 = c("A", "A", "A", "B", "B", "B", "C", "C", "C", "C"),
column2 = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)), row.names = c(NA, -10L),
class = c("tbl_df","tbl", "data.frame")) %>%
left_join(x = ., y = geo_data, by = "idx", keep = FALSE)
sf <- sf::st_as_sf(table)
# Shiny
ui <- fluidPage(
fluidRow(
column(
width = 10, offset = 1,
tags$h3("Filter data with selectize group"),
panel(
selectizeGroupUI(
id = "my-filters",
params = list(
column1 = list(inputId = "column1", title = "column1:"),
column2 = list(inputId = "column2", title = "column2:")
)
), status = "primary"
),
leafletOutput(outputId = "map")
)
)
)
server <- function(input, output, session) {
res_mod <- callModule(
module = selectizeGroupServer,
id = "my-filters",
data = sf,
vars = c("column1", "column2"))
output$map <- renderLeaflet({
leaflet() %>%
addPolylines(data = res_mod())
})
}
shinyApp(ui, server)
When res_mod() is called, it returns a data.frame but you can coerce it back again using st_as_sf() like any other dataframe object that has a geometry column in it.
output$map <- renderLeaflet({
leaflet() %>%
addPolylines(data = st_as_sf(res_mod()))
})
After that output$map starts working again.

Column headers of Shiny data table gets shifted

When I run my Shiny app, the headers of my data tables get shifted to the left. See below.Say this table is on Tab A.
The headers get aligned correctly when I click on a different tab (Tab B),then click on Tab A again. See below for the corrected headers.
Any idea what's causing it? Below is a simplified version of my code. Thanks in advance!
ui.R
library("shinythemes")
fluidPage(title = "Segmentation App", theme = shinytheme("spacelab"),
navbarPage("Segmentation", id = "allResults",
tabPanel(value='result_scorecard', title='ScoreCard',
sidebarLayout(
sidebarPanel(
h4("Select a cluster solution to profile"),
width = 3
),
mainPanel(
verticalLayout(
helpText(strong('Summary of Cluster Solutions')),
column(DT::dataTableOutput('out_best'), width = 12),
helpText(strong('ScoreCard Table')),
column(DT::dataTableOutput('out_scorecard'), width = 12)
)
)
)
),
tabPanel(value='profile', title='Profile',
verticalLayout(
column(DT::dataTableOutput('prop_by_cluster_ind'), width=10)
)
)
)
)
server.R
function(input, output, session) {
best_sols <- reactive({
A <- c(100, 101, 201)
B <- c(100, 101, 201)
C <- c(100, 101, 201)
temp <- as.matrix(cbind(A, B, C))
colnames(temp) <- c("A", "B", "C")
rownames(temp) <- c("k=1","k=2","k=3")
return(temp)
})
score_seg <- reactive({
A <- c("solution=1","solution=2","solution=3","solution=4","solution=5")
B <- c(100, 101, 201, 333, 444)
C <- c(100, 101, 201, 333, 444)
temp <- data.frame(A, B, C)
colnames(temp) <- c("A", "B", "score_seg")
return(temp)
})
profile_result_ind <- reactive({
A1 <- c("var1","var2","var3","var4","var5")
A2 <- c("var1","var2","var3","var4","var5")
B <- c(100, 101, 201, 333, 444)
C <- c(100, 101, 201, 333, 444)
temp <- data.frame(A1, A2, B, C)
colnames(temp) <- c("","","1","2")
return(temp)
})
# Table 1
output$out_best <- DT::renderDataTable({
DT::datatable(best_sols(), caption = "", rownames = TRUE, options = list(autoWidth = TRUE, scrollX = TRUE, columnDefs = list(list(width = '100px', targets = 1)), paging = FALSE, searching = FALSE), selection='none') %>% formatRound(1:5, 3)
#}
})
# Table 2
output$out_scorecard <- DT::renderDataTable({
DT::datatable(score_seg(), caption = "", rownames = F, options = list(autoWidth = TRUE, scrollX = TRUE, columnDefs = list(list(width = '200px', targets = 1)), paging = FALSE, searching = FALSE), selection='single') %>% formatRound(1:5, 3)
})
# Table 3
output$prop_by_cluster_ind <- DT::renderDataTable({
DT::datatable(profile_result_ind(), class= 'compact stripe', caption = '', rownames = F, options = list(autoWidth = TRUE, scrollX = TRUE, columnDefs = list(list(width = '300px', targets = 1), list(className = 'dt-left', targets="_all")), paging = FALSE, searching = FALSE)) %>% formatStyle(as.character(seq(1:2)))
})
}
I figured it out.
The headers will be aligned correctly if we change the autoWidth option to FALSE.
I had a table with long rownames such as you and had a similar problem with offset column names, but setting autoWidth=FALSE did not solve the problem. I discovered that it was being caused by scrollX=TRUE. I changed ScrollX=FALSE and wrapped the datatable in a div with overflow-x=TRUE to regain the scroll feature:
div(style="overflow-x:auto",renderDataTable({tableName},options=list(scrollX=FALSE))

shinyTree not rendering checkbox output

I am using shinyTree to render a data table. The following is the dataset with codes used so far:
library(shiny)
library(shinyTree)
newdat <- structure(list(RESPID = c("41000123", "41004132", "41006132",
"41007121", "41007123"), PDT_A = c(125, 66, 45, 28,
0), PDT_B = c(10, 0, 0, 0, 0), PDT_C = c(0, 0, 0, 0, 0), PDT_D = c(450,
105, 75, 192, 0), PDT_TOTAL = c(585, 171, 120, 220, 0)), .Names = c("RESPID",
"PDT_A", "PDT_B", "PDT_C", "PDT_D", "PDT_TOTAL"), row.names = c("6",
"40", "56", "59", "61"), class = "data.frame")
server <- shinyServer(function(input, output, session) {
newdata <- reactive({newdat})
output$tree <- renderTree({
sss=list('TOTAL_VALUE'= list('TOTAL_VALUE_OF_MERCHANDISE' = structure(list('PDT_TOTAL'='1001'), stopened=FALSE),
'PDT_CAT' = structure(list('PDT_TOTAL'='1002','PDT_A'='152','PDT_B'='153','PDT_C'='154','PDT_D'='155'), stopened=FALSE)
))
attr(sss[[1]],"stopened")=FALSE
sss
})
catdat <- reactive({
tree <- input$tree
unlist(get_selected(tree))
})
coldat <- reactive({
newdata()[,catdat()]
})
output$datatab <- renderDataTable({
coldat()
})
})
ui <- shinyUI(
pageWithSidebar(
headerPanel("TEST"),
sidebarPanel(
shinyTree("tree", checkbox = TRUE)
),
mainPanel(
dataTableOutput("datatab")
)
))
shinyApp(ui,server)
The tree gets generated. I have following trouble in rendering the columns through data table output:
The first branch of the tree, refers to only one column: which is not rendering in shiny. I am getting an error message undefined columns selected.
The second branch of the tree supposed to render all five columns of the table. However it renders only any four of the columns.
If i select root of the second branch, i am getting the same undefined columns selected. When I uncheck one of the branch the table with 4 columns gets rendered.
How do i render all the columns?
Is there a way where I can remove the check boxes at the branch root / nodes level?
Ad 1. You get this error because if you select the first branch of the tree, then catdat() returns a vector with "PDT_TOTAL" and "TOTAL_VALUE_OF_MERCHANDISE" and there is no such variable as "TOTAL_VALUE_OF_MERCHANDISE" in your dataset.
Ad 2. If you select all five options then catdat() returns additionally "PDT_CAT" and you have the same problem as above - there is no such variable in your dataset. (Same above - if you select all options, so "PDT_TOTAL", it returns additionally "TOTAL_VALUE_OF_MERCHANDISE")
To render all columns you could do following:
First, select dynamically variables from your dataset and then remove duplicates as catdat() returns twice "TOTAL_VALUE" when the very first option TOTAL_VALUE is selected.
There is also another issue: newdata()[,vars] returns a vector if there is only one variable selected and renderDataTable won't print anything as it works only with dataframes. To address this issue you can remove , to ensure that the subsetting returns always a dataframe - newdata()[vars]
coldat <- reactive({
vars <- catdat()
vars <- vars[!(vars %in% c("TOTAL_VALUE", "TOTAL_VALUE_OF_MERCHANDISE", "PDT_CAT"))]
vars <- unique(vars)
print(vars)
# newdata()[,vars] # If you select only one variable then this reactive returns an object of class numeric and not a data.frame
newdata()[vars] # remove "," and it will always return a data frame
})
Full example:
library(shiny)
library(shinyTree)
newdat <- structure(list(RESPID = c("41000123", "41004132", "41006132",
"41007121", "41007123"), PDT_A = c(125, 66, 45, 28,
0), PDT_B = c(10, 0, 0, 0, 0), PDT_C = c(0, 0, 0, 0, 0), PDT_D = c(450,
105, 75, 192, 0), PDT_TOTAL = c(585, 171, 120, 220, 0)), .Names = c("RESPID",
"PDT_A", "PDT_B", "PDT_C", "PDT_D", "PDT_TOTAL"), row.names = c("6",
"40", "56", "59", "61"), class = "data.frame")
server <- shinyServer(function(input, output, session) {
newdata <- reactive({newdat})
output$tree <- renderTree({
sss=list('TOTAL_VALUE'= list('TOTAL_VALUE_OF_MERCHANDISE' = structure(list('PDT_TOTAL'='1001'), stopened=FALSE),
'PDT_CAT' = structure(list('PDT_TOTAL'='1002','PDT_A'='152','PDT_B'='153','PDT_C'='154','PDT_D'='155'), stopened=FALSE)
))
attr(sss[[1]],"stopened")=FALSE
sss
})
catdat <- reactive({
tree <- input$tree
unlist(get_selected(tree))
})
coldat <- reactive({
vars <- catdat()
vars <- vars[!(vars %in% c("TOTAL_VALUE", "TOTAL_VALUE_OF_MERCHANDISE", "PDT_CAT"))]
vars <- unique(vars)
print(vars)
# newdata()[,vars] # If you select only one variable then this reactive returns an object of class numeric and not a data.frame
newdata()[vars] # remove "," and it will always return a data frame
})
output$datatab <- renderDataTable({
coldat()
})
})
ui <- shinyUI(
pageWithSidebar(
headerPanel("TEST"),
sidebarPanel(
shinyTree("tree", checkbox = TRUE)
),
mainPanel(
dataTableOutput("datatab")
)
))
shinyApp(ui,server)