suppressPackageStartupMessages(library(AnalysisToolkit)) library(knitr) library(pander) library(ggplot2) knitr::opts_chunk$set(collapse=TRUE, comment="#>", results="markup", fig.show='hold', fig.align="center", fig.height=8, fig.width=8, message=FALSE, warning=FALSE, cache=TRUE) panderOptions("knitr.auto.asis", FALSE) theme_set( theme_bw(base_size=14) + theme( # legend.position="bottom", legend.key=element_rect(colour=NA), plot.margin=unit(c(0.5, 0.5, 0.5, 0.5), "cm") ) ) set.seed(123) PROJECT_DIR <- Sys.getenv('PROJECT_DIR')
data(classifiers, package="AnalysisToolkit") str(classifiers, list.len=2)
accumulate_gg_dots <- function(...) { Reduce(`+`, list(...), accumulate=TRUE) } accumulate_gg_dots( ggplot(mtcars, aes(x=disp, y=cyl)) + geom_point(), geom_smooth(), xlab(NULL), ylab(NULL) )
tidy_curves <- map_dfr(classifiers$classifier_curves, tidy, .id="grader") %>% nest(-id, -Y, .key = pY_by_grader) tidy_points <- map_dfr(classifiers$classifier_point, tidy, .id = "grader") %>% nest(-id, -Y, .key = Y_by_grader) tidy_df <- inner_join(tidy_points, tidy_curves, c("id", "Y")) tidy_df tidy_df %>% `[`(1, ) %>% use_series(Y_by_grader) %>% kable tidy_df %>% `[`(1, ) %>% use_series(pY_by_grader) %>% kable
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.