R/find_name.R

Defines functions find_name

Documented in find_name

#' find pattern in name's dataset
#'
#' @param dataset a data.frame (or list or anything with names parameter)
#' @param pattern pattern we are looking for
#'
#' @return a list with position and value
#' @export
#'
#' @examples
#'
#' find_name(iris,"Sepal")
find_name <- function(dataset,pattern){
  vec<-grep(pattern,names(dataset))
  list(rang=vec,valeur=names(dataset)[vec])
}

Try the thinkr package in your browser

Any scripts or data that you put into this service are public.

thinkr documentation built on Aug. 22, 2022, 5:05 p.m.