FreesearchR/man/line_break.Rd
Andreas Gammelgaard Damsbo efc3f8acc3
Some checks are pending
pkgdown.yaml / pkgdown (push) Waiting to run
minor steps
2025-03-12 18:27:46 +01:00

26 lines
725 B
R

% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/data_plots.R
\name{line_break}
\alias{line_break}
\title{Line breaking at given number of characters for nicely plotting labels}
\usage{
line_break(data, lineLength = 20, fixed = FALSE)
}
\arguments{
\item{data}{string}
\item{lineLength}{maximum line length}
\item{fixed}{flag to force split at exactly the value given in lineLength.
Default is FALSE, only splitting at spaces.}
}
\value{
character string
}
\description{
Line breaking at given number of characters for nicely plotting labels
}
\examples{
"Lorem ipsum... you know the routine" |> line_break()
paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(fixed = TRUE)
}