R/nchars_row.R

Defines functions too_many_chars nchars_row

nchars_row <- function(df) {

require(tidyverse)

nrows <- tibble()

for (i in 1:nrow(df)) {

  temp <- df %>%
    slice(i)

  temp <- nchar(temp)

  nrows <- bind_rows(nrows,temp)

}

nrows$total_chars <- rowSums(nrows)

return(nrows)

}

too_many_chars <- function(df,number) {

  x  <- df %>%
    mutate(over = total_chars > number) %>%
    filter(over == TRUE) %>%
    pull(over)

  return(x)
}
neugelb/neugelbtools documentation built on July 7, 2020, 1:17 a.m.