R/helper_insert_newline.R

Defines functions insert_newline

# Insert newline every X characters
insert_newline <- function(string, every_x_chars) {
  gsub(paste0("(.{", every_x_chars, "})"), "\\1\n", string)
}

Try the rfriend package in your browser

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

rfriend documentation built on Aug. 8, 2025, 7:33 p.m.