所以我提出了一个带有一些单选按钮和滑块的Shiny应用程序,如下所示:
library(shiny)
shinyUI(fluidPage(
titlePanel("test"),
sidebarLayout(
sidebarPanel(
sliderInput("smplSize", "Number of samples:", min = 10, max = 500, value = 250),
hr(),
radioButtons("pType",
label = "Choose plot type:",
choices = c("Normal" = "norm", "t-dist" = "tdist"),
inline = T),
sliderInput("mean", "Value for mean:", min = 0, max = 10, value = 0),
sliderInput("sd", "Value for sd:", min = 0.1, max = 5, value = 1),
sliderInput("df", "Degrees of freedom:", min = 1, max = 50, value = 1),
hr()
),
mainPanel(
plotOutput("normalDist2")
)
)
))
当我运行应用程序时,一切正常,但是,我看不到单选按钮,但我能够选择它们并server.R
响应我的更改......
我拍了一张应用的截图:
如您所见,圆圈未显示,但是,通过点击标签,我可以修改server.R
中编码的绘图输出
sessionInfo()
的输出:
R version 3.1.2 (2014-10-31)
Platform: x86_64-apple-darwin13.4.0 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] reshape2_1.4.1 rmarkdown_0.9.5 knitr_1.12.3 heatmap3_1.1.1 ggthemes_3.0.2 gridExtra_2.2.1
[7] tidyr_0.4.1 dplyr_0.4.3 ggplot2_2.1.0 shiny_0.13.1
loaded via a namespace (and not attached):
[1] assertthat_0.1 colorspace_1.2-6 DBI_0.3.1 digest_0.6.9 fastcluster_1.1.16
[6] grid_3.1.2 gtable_0.2.0 htmltools_0.3 httpuv_1.3.3 jsonlite_0.9.19
[11] labeling_0.3 magrittr_1.5 mime_0.4 munsell_0.4.3 parallel_3.1.2
[16] plyr_1.8.3 R6_2.1.2 Rcpp_0.12.3 scales_0.4.0 stringi_1.0-1
[21] stringr_1.0.0 tools_3.1.2 xtable_1.8-2