# Generate data.frames by extending broom's S3 `tidy()`
#' @include Classifiers-class.R
NULL
#' Tidy methods to enframe Classifiers.
#'
#' @name tidy_Classifier
#'
#' @family tidy
#' @export
#'
#' @examples
#' \dontrun{
#' map_dfr(classifiers$classifier_point, tidy, .id = "grader") %>% nest(-id, -Y, .key = Y_by_grader)
#' }
tidy_ClassifierPoint <- function(Classifier) {
slot_names <- class(Classifier) %>% slotNames() %>% set_names
purrr::map_dfc(slot_names, slot, object=Classifier) %>%
select(id, Y_, Y) %>%
arrange(id)
}
#' @rdname tidy_Classifier
#' @export
#' @examples
#' \dontrun{
#' map_dfr(classifiers$classifier_curve, tidy, .id="grader") %>% nest(-id, -Y, .key=pY_by_grader)
#' }
tidy_ClassifierCurve <- function(Classifier){
slot_names <- class(Classifier) %>% slotNames() %>% set_names
purrr::map_dfc(slot_names, slot, object=Classifier) %>%
select(id, pY, Y) %>%
arrange(id)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.