R/is_lemme.R

Defines functions is_lemme

Documented in is_lemme

#' Is the word a lemme?
#'
#' @param df a data frame
#' @param col the column with words
#'
#' @return a tibble
#' @export
#'
#' @examples
#' a <- data.frame(words = c("mer", "poulet", "lapin"))
#' is_lemme(a, words)

is_lemme <- function(df, col){
  data(list = "lexique", package = "lexiquer", envir = environment())
  col <- enexpr(col)
  lex <- lexique %>%
    mutate(islem = as.logical(islem)) %>%
    select(ortho, islem) %>%
    rename(!! col := ortho)
  left_join(df, lex)
}
ColinFay/lexiquer documentation built on May 6, 2019, 2:19 p.m.