Date: r lubridate::today()

# headers in taglist will appear in toc but they will not be numbered, numbering is added by rmarkdown
knitr::opts_chunk$set(echo = TRUE
                      , warning = FALSE
                      , message = FALSE
                      , include = TRUE
                      , echo = FALSE
                      , results = 'markdown')
if( ! is_empty(params$dist) & length(params$dist) == 2 ){

  print( htmltools::h1('Distributions of Model Predictions') )

  print( htmltools::h2('Boxplots') )

  print( params$dist[[1]] )

  print( htmltools::h2('Histograms') )

  print( params$dist[[2]] )

}
#header
print( params$obj_list[[1]] )
# residual point plot headers

params$obj_list[[2]][[1]][[1]]

params$obj_list[[2]][[1]][[1]]
# residual point plot, screenshot only works if html widget is not insidel taglist

params$obj_list[[2]][[1]][[3]]
# residual boxplots

params$obj_list[[3]]
# ape point plots, headers

params$obj_list[[4]][[1]][[1]]

params$obj_list[[4]][[1]][[2]]
# ape point plots, are too memory intensive, so we use screenshot
#screenshot only works if html widget is outside taglist

params$obj_list[[4]][[1]][[3]]
# rest of the summary plots

params$obj_list[[5]]
params$obj_list[[6]]
params$obj_list[[7]]
params$obj_list[[8]]
params$obj_list[[9]]
if( ! is_empty(params$alluvial) & inherits( params$alluvial, 'ggplot' ) ){

  #calculate alluvial fig.height

  n_levels = length( levels( params$alluvial$data$x ) )

  fig_height = 5/3 * n_levels

}else{

  fig_height = 5

}
if( ! is_empty(params$alluvial) & inherits( params$alluvial, 'ggplot' ) ){

  print( htmltools::h1('Alluvial Plot of Residuals') )

  print( params$alluvial )

}
params$obj_list[[10]]
params$obj_list[[11]]
params$obj_list[[12]]


erblast/oetteR documentation built on May 27, 2019, 12:11 p.m.