R/GetIndex.R

Defines functions GetIndex

Documented in GetIndex

#' dplyr equivalent to which
#'
#' @param data dataframe
#' @param conditions logical vector
#'
#' @return numeric vector of indices satisfying conditions
#' @export
#'
GetIndex <- function(data,conditions){

  data %>% tibble::rownames_to_column() %>%
  filter(conditions) %>% `[[`("rowname") %>% as.numeric() 

}
DavidGarciaCallejas/DGC documentation built on May 6, 2019, 1:54 p.m.