R/arrange.R

Defines functions arrange_investigators_by_role

Documented in arrange_investigators_by_role

#' Arrange investigator table by role
#'
#' Grant roles have a certain hierarchy (PI, Co-I, postdoc, etc). This function
#' will sort the investigators by this predefined hierarchy.
#'
#' The package variable `role_order` defines the order of roles to be considered.
#'
#' @param investigators An investigators tibble
#'
#' @return A sorted investigators table, ordered by investigator role.
#' @export
#'
arrange_investigators_by_role<-function(investigators) {


  dplyr::arrange(investigators, match(investigator_role, role_order))

}
steveneschrich/pgreportr documentation built on Jan. 13, 2025, 7:09 p.m.