get_xaxis_breaks: Returns nice major and minor breaks and label format based on...

View source: R/helpers_plot.R

get_xaxis_breaksR Documentation

Returns nice major and minor breaks and label format based on timespan of the data

Description

Returns nice major and minor breaks and label format based on timespan of the data

Usage

get_xaxis_breaks(dat.tidy)

Arguments

dat.tidy

Data to be plotted, in tidy format, as returned by the function convert_to_tidydata(). Must include the column TIMESTAMP (POSIXct).

Details

If the timespan in the TIMESTAMP column of dat.tidy is less than or equal to 60 days, the major and minor breaks will be every 2 weeks; if time span is greater than 60 days and less than or equal to 120 days, the major and minor breaks will be every month; if time span is greater than 120 days and less than or equal to 240 days, the major breaks will be 2 months and the minor breaks will be 1 month; if the time span is greater than 240 days, the major breaks will be 4 months and the minor breaks will be 1 month.

Value

Returns a dataframe with 1 observation of 3 variables date.breaks.major, date.breaks.minor, date.labels.format.

Author(s)

Danielle Dempsey

See Also

Other plot: get_colour_palette(), plot_variables_at_depth()


Centre-for-Marine-Applied-Research/strings documentation built on Aug. 21, 2023, 8 a.m.