R/get-index-mod.R

Defines functions get_index_mod

Documented in get_index_mod

#' Exctract index of specific modalities.
#'
#' @param df_gda GDA optimised data frame.
#' @param pattern search pattern (regular expression).
#'
#' @return indices of modalities.
#' @export
get_index_mod <- function(df_gda, pattern = "Fehlender Wert") {

  res <- sort(as.numeric(c(which(grepl(pattern, colnames(GDAtools::dichotom(df_gda)))))))

  if(nrow(data.frame(res)) == 0) res <- NULL

  res
}
inventionate/TimeSpaceAnalysis documentation built on June 13, 2025, 2:48 p.m.