FreesearchR/man/line_break.Rd

27 lines
723 B
Text
Raw Normal View History

2025-03-05 21:13:06 +01:00
% 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{
2025-03-11 13:42:57 +01:00
line_break(data, lineLength = 20, fixed = FALSE)
2025-03-05 21:13:06 +01:00
}
\arguments{
2025-03-11 13:42:57 +01:00
\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
2025-03-05 21:13:06 +01:00
}
\description{
Line breaking at given number of characters for nicely plotting labels
}
2025-03-11 13:42:57 +01:00
\examples{
"Lorem ipsum... you know the routine" |> line_break()
paste(sample(letters[1:10], 100, TRUE), collapse = "") |> line_break(fixed=TRUE)
}