% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.mnirs.R
\name{format_hmmss}
\alias{format_hmmss}
\title{Format time span data as h:mm:ss}
\usage{
format_hmmss(x)
}
\arguments{
\item{x}{A numeric vector.}
}
\value{
A character vector the same length as \code{x}.
}
\description{
Convert numeric time span data to \code{h:mm:ss} format for pretty plotting.
Inspired by \code{\link[ggplot2:scale_date]{ggplot2::scale_x_time()}}.
}
\details{
If all values are less than 3600 (1 hour), then format is returned as
\code{mm:ss}. If any value is greater than 3600, format is returned as
\code{h:mm:ss} with leading zeroes.
}
\examples{
\dontshow{if (rlang::is_installed("ggplot2")) withAutoprint(\{ # examplesIf}
x <- 0:120
y <- sin(2 * pi * x / 15) + rnorm(length(x), 0, 0.2)

ggplot2::ggplot(data.frame(x, y), ggplot2::aes(x, y)) +
    theme_mnirs() +
    ggplot2::scale_x_continuous(
        breaks = breaks_timespan(),
        labels = format_hmmss
    ) +
    ggplot2::geom_line()
\dontshow{\}) # examplesIf}
}
