R/legal.R

Defines functions legal

Documented in legal

#' Check legal character
#' Whether the character is legal for names in dataframe or formula
#' @param ... one or more string
#'
#' @return logical, TRUE means legal.
#' @export
#'
#' @examples
#' legal('a','b','a b')
legal <- function(...){
    # one or more string
    string <- c(...)
    sapply(string,function(i) i == make.names(i))
}

Try the do package in your browser

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

do documentation built on Aug. 3, 2021, 5:06 p.m.