#' @title Identifies numerics
#'
#' @description A function to recognize if the content of a column seems to be numeric.
#'
#' @author Briac LE RAY (briac.leray@partnre.com)
#'
#' @return TRUE if the column seems to contain dates, otherwise FALSE.
#' @param df_column The column to control. Type = dataframe
#' @keywords detect numeric detect_numeric() control
#' @examples detect_numeric(df_column = my_column)
detect_numeric <- function(df_column) {
if(all(str_detect(df_column, "[a-z]", negate = TRUE), na.rm = TRUE) & all(str_detect(df_column, "\\W", negate = TRUE), na.rm = TRUE)) { return(TRUE)} #search for a non numeric character
return(FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.