File: multitrace.R

package info (click to toggle)
r-cran-shinystan 2.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,172 kB
  • sloc: sh: 15; makefile: 7
file content (55 lines) | stat: -rw-r--r-- 1,786 bytes parent folder | download | duplicates (2)
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
# 
# # multiparameter traceplots -----------------------------------------------
# calc_height_trace_plot <- reactive({
#   params <- input$multitrace_params
#   grid <- FALSE
#   if (!is.null(input$multitrace_layout)) {
#     if (input$multitrace_layout == "Grid") grid <- TRUE
#   }
#   params <- .update_params_with_groups(params, param_names)
#   LL <- length(params)
#   if (LL == 0) LL <- 4
#   if (LL == 1) LL <- 2
#   if (grid) {
#     if (LL > 5) return(30*LL)
#     if (LL < 5) return(60*LL)
#   }
#   round(100*LL)
# })
# 
# # multitrace_plot
# multitrace_plot <- reactive({
#   validate(need(!is.null(input$multitrace_rect), message = "Loading..."))
#   x1 <- input$multi_xzoom[1]
#   x2 <- input$multi_xzoom[2]
#   dat <- samps_all[x1:x2,,,drop=FALSE]
#   # zoom <- "On"
#   do.call(".param_trace_multi", args = list(
#     params      = input$multitrace_params,
#     all_param_names = param_names,
#     dat         = dat,
#     chain       = input$multitrace_chain,
#     warmup_val  = warmup_val,
#     palette     = input$multitrace_palette ,
#     rect        = input$multitrace_rect,
#     rect_color  = "skyblue",
#     rect_alpha  = input$multitrace_rect_alpha,
#     layout      = input$multitrace_layout,
#     x1          = x1,
#     x2          = x2
#   ))
# })
# 
# output$multitrace_plot_out <- renderPlot({
#   x <- multitrace_plot()
#   suppressWarnings(print(x)) # this avoids warnings about removing rows when using tracezoom feature
# }, height = calc_height_trace_plot, bg = "transparent")
# 
# # download the plot
# output$download_multitrace <- downloadHandler(
#   filename = paste0('shinystan_multitrace.RData'),
#   content = function(file) {
#     shinystan_multitrace <- multitrace_plot()
#     save(shinystan_multitrace, file = file)
#   }
# )