#' Generic data import function
#'
#' @return
#' @export
#' @import dplyr
#' @examples
generic_import <- function() {
path <- './data-raw/'
imports_name <- list(list("anqi", .5), list("rcw", .5), list("arw", .5), list("can", 1))
human.search.uniform <- lapply(imports_name, FUN = function(x) {
name <- x[[1]]
offset <- x[[2]]
human.search.uniform <- humansearchdata::import_human(paste0(path, '/uniform')) %>%
dplyr::mutate(experiment = "uniform") %>%
dplyr::mutate(sample_type = "uniform") %>%
dplyr::mutate(radius = 8) %>%
filter(subject == name) %>%
humansearchdata::add_threshold(., offset = offset) %>%
humansearchdata::add_accuracy()
}) %>%
dplyr::bind_rows()
human.search.polar <- lapply(imports_name, FUN = function(x) {
name <- x[[1]]
offset <- x[[2]]
human.search.polar <- humansearchdata::import_human(paste0(path, '/polar')) %>%
dplyr::mutate(experiment = "polar") %>%
dplyr::mutate(sample_type = "polar") %>%
dplyr::mutate(radius = 8) %>%
filter(subject == name) %>%
humansearchdata::add_threshold(., offset = offset) %>%
humansearchdata::add_accuracy()
}) %>%
dplyr::bind_rows()
combined_search <- dplyr::bind_rows(list(human.search.uniform,
human.search.polar))
combined_search <- combined_search %>% dplyr::select(-trial, -bgSize)
combined_search$tLevel <- round(as.numeric(combined_search$tLevel),3)
combined_search$radius <- round(as.numeric(combined_search$radius),3)
combined_search$contrast <- combined_search$tLevel
return(combined_search)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.