specify_damage.Rd
specify_damage() uses tidyr functions to filter a dataframe containing a summary of damaged areas for all samples and adapt it for later use in cleaning functions.
specify_damage(sample, data)
data | Dataframe with summary of damaged brain areas for all samples. Long format in which each row is a damaged area. Requires the following variables: "sample" with the name of the sample; "area" with the acronym of damaged brain area according to Allen Brain Atlas nomenclature; "hemisphere" to specify which hemisphere. |
---|---|
sample_id | String used to select relevant sample. |
x <- data.frame( sample_id = c(1,1,2,3), area = c("BLA", "VTA", "CA1", "DG"), hemisphere = c("left", "left", "right", "right") ) my_sample <- 1 specify_damage(my_sample, x)#> Error in data %>% dplyr::filter(sample_id == sample) %>% dplyr::mutate(area_hemisphere = paste(area, hemisphere, sep = "_")) %>% droplevels(): could not find function "%>%"