#' Calculates raw score for games with accuracy of interest
#'
#' This function will output the percent of correct only.
#'
#' @param data Raw data of class \code{data.frame}.
#' @param ... Other input argument for future expansion.
#' @return The raw score calculated of \code{double} type.
#' @importFrom magrittr %>%
#' @export
accuracy <- function(data, ...) {
if (!utils::hasName(data, "ACC")) {
warning("Accuracy (ACC) variable is required.")
return(NA_real_)
}
if (mean(data$ACC == -1) >= 0.2) {
warning("Response rate is too low.")
return(NA_real_)
}
mean(data$ACC == 1)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.