R/tilde.R

Defines functions `notilde` `hastilde` `tilde1st`

`tilde1st` <- function(x) {
    is.element(
        substring(
            gsub(
                paste0("[[:space:]|", "\u00a0", "]"), # multibyte space
                "",
                x
            ),
            1, 1
        ),
        tildae()
    )
}

`hastilde` <- function(x) {
    grepl(paste(tildae(), collapse = "|"), x)
}

`notilde` <- function(x) {
    gsub(
        paste(tildae(), collapse = "|"),
        "",
        gsub(
            paste0("[[:space:]|", "\u00a0", "]"), # multibyte space
            "",
            x
        )
    )
}

Try the admisc package in your browser

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

admisc documentation built on Sept. 12, 2024, 6:27 a.m.