order_brain_areas.Rd
By using expression levels in different groups (e.g. time points), brain areas are ordered .
order_brain_areas( region_df, order_of_groups, count_var = "cells_perthousand_box_scaled_ba" )
region_df | region_based dataframe. Each row is a brain area ("my_grouping") per sample, with a variable for counts (e.g. "cells_perthousand_box_scaled_ba"). The variable "group" specifies the experimental group, and it is used for the ordering. It can be output from summarize_per_region() or preprocess_per_region(). |
---|---|
order_of_groups | string with the same unique elements as region_df$group, but ordered as should be used for the analysis. |
count_var | variable specified by the user on which to conduct the analysis. |
# baby example x <- data.frame( batch = rep(c("1", "2"), 2), group = rep(rep(c("0", "90"), each = 2), 2), my_grouping = "CA1", cells_perthousand_box_scaled_ba = c(-2, -1, 2, 1, -3, -2, 4, 2) ) order_brain_areas(x, order_of_groups = c("0", "90"))#> Error in region_df %>% dplyr::select(group, my_grouping, !!count_var): could not find function "%>%"