-
Notifications
You must be signed in to change notification settings - Fork 2
/
ui.R
104 lines (94 loc) · 4.2 KB
/
ui.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
################################################################
# BOOTSRAPPING ALGORITM
# Lauri Vesa, FAO. 1 March 2019
# updated LV: 9 April 2021
# the script takes random samples from 'sampleplots' data, with given interval ('s_step') and min/max limits
# and 'n_simulations' times at each case, and computes statistics (mean, variance, standard error, relative standard error, confidence intervals 95%)
# and makes graphs and non-linear model ('m1') of the form
# 'c1*nplots^c2' where c1 and c2 are model parameters, nplots=number of samples.
# More about applied method at http://www.fs.fed.us/emc/rig/Plot-GEM/
################################################################
library('shinydashboard')
library('DT')
library('markdown')
ui <- function(request) {
header <- dashboardHeader(
title = "Bootstrap sampling simulation",
titleWidth = 350
)
body <- dashboardBody(
navbarPage(
"",
tabPanel("Application",
sidebarPanel(
checkboxInput("header", "Headers in CSV", TRUE),
fileInput("file1", "Upload CSV File",
accept = c(
"text/csv",
"text/comma-separated-values,text/plain",
".csv")
),
selectInput("sel_variable", "Variable:", choices=""),
fluidRow(
column(6,
selectInput("sel_stratum", "Stratum:",
choices="")),
column(6,
selectInput("sel_stratum_var", "Category in stratum:",
choices=""))
),
splitLayout(
numericInput("min_s_size", "Min. sample:", 10),
numericInput("max_s_size", "Max. sample:", 100),
numericInput("s_step", "Step:", 13)),
fluidRow(
column(6,
numericInput("n_simulations", "Number of simulations:", 20)),
column(6,
selectInput("ci_level", "Confidence Level:",
choices=c("0.80","0.90","0.95","0.98","0.99"), selected ="0.95")
)),
sliderInput("slider_error", "Acceptable Percent Error:", 1, 100, 20),
tags$h5("Select curves:"),
checkboxInput("curve_exact", "Exact curve", FALSE),
checkboxInput("curve_exact_smoothed", "Exact smoothed curve", TRUE),
# checkboxInput("curve_modeled", "Modeled error curve", FALSE),
checkboxInput("curve_error", "Acceptable error", TRUE),
# tags$h5("actionButton with CSS class:"),
actionButton("action_plot", "Plot curves", class = "btn-primary")
),
mainPanel(
tabsetPanel(
tabPanel("Results",
tags$br(),
splitLayout(
plotOutput("plot1"),
plotOutput("plot2")),
hr(),
tableOutput("summarytable"),
# h4("Verbatim text output"),
verbatimTextOutput("txtout1"),
# p(tags$h5("Relative standard error (RSE) curve non-linear model parametes:")),
verbatimTextOutput("txtout2")
),
tabPanel("Result table",
tableOutput("df_result_data")
),
tabPanel("Data",
tags$br(),
dataTableOutput("contents")
)
)
)
),
tabPanel("About",
includeMarkdown("www/releases.md")
)
))
dashboardPage(
skin='green',
header,
dashboardSidebar(disable = TRUE),
body
)
}