@@ -470,6 +470,26 @@ app_server <- function( input, output, session ) {
470
470
)
471
471
})
472
472
473
+ raw.table <- eventReactive(input $ go , {
474
+ traj_list_to_df(x = switch (input $ crad ,
475
+ " n_yr" = {
476
+ list (
477
+ high.list.const(),
478
+ med.list.const(),
479
+ low.list.const(),
480
+ zero.list.const()
481
+ )
482
+ },
483
+ " rate2" = {
484
+ list (
485
+ high.list.rate(),
486
+ med.list.rate(),
487
+ low.list.rate(),
488
+ zero.list.rate()
489
+ )
490
+ }
491
+ ))
492
+ })
473
493
# Observe() values --------------------------------------------------------
474
494
475
495
@@ -1103,6 +1123,15 @@ app_server <- function( input, output, session ) {
1103
1123
}
1104
1124
) # / downloadHandler
1105
1125
1126
+
1127
+ # DOWNLOAD RAW RESULTS ----------------------------------------------------
1128
+ output $ rawouts <- downloadHandler(
1129
+ filename = paste(" projoutput-" , Sys.Date(), " .csv" , sep = " " ),
1130
+ content = function (file ) {
1131
+ write.csv(raw.table(), file )
1132
+ }
1133
+ ) # / downloadHandler
1134
+
1106
1135
1107
1136
# DOCUMENTATION -----------------------------------------------------------
1108
1137
dpath <- reactive(app_sys(" Documentation" ,
@@ -1502,7 +1531,10 @@ app_server <- function( input, output, session ) {
1502
1531
p(i18n $ t(" Would you like to download a report of your inputs and outputs? The button below will write an html file that you can save and share." )),
1503
1532
br(),
1504
1533
p(i18n $ t(" Make sure you have clicked" ), em(i18n $ t(" Run Projections." ))),
1505
- downloadButton(outputId = " report" , i18n $ t(" Generate report" ))
1534
+ downloadButton(outputId = " report" ,
1535
+ i18n $ t(" Generate report" )),
1536
+ downloadButton(outputId = " rawouts" ,
1537
+ " Download raw projections" )
1506
1538
), # end PBR tab
1507
1539
tabPanel(
1508
1540
i18n $ t(" Solve for Bycatch" ),
0 commit comments