Skip to contents

Determine axis breaks automatically for time variables

Usage

breaks_time(x, unit = "hours", n = 8)

Arguments

x

Numeric vector of times from which to determine breaks

unit

Character string for time units. Options include:

  • "hours" (default)

  • "days"

  • "weeks"

  • "months"

n

Ideal number of axis breaks requested (default = 8). Passed to labeling::extended()

Value

A numeric vector of breaks

Examples

ntimes <- sort(unique(data_sad$NTIME))
breaks <- breaks_time(ntimes)