ch_sub_set_Years {CSHShydRology}R Documentation

Helper function for selecting points for an axis

Description

Sub-samples a vector every n places. Many times there are so many years the labels on the plot overlap. ch_sub_set_years returns the position and label for the subset. The function can be used on any type of simple array.

Usage

ch_sub_set_Years(years, n)

Arguments

years

a vector of years

n

sample size

Value

a list containing:

position

array of axis positions

label

array of labels

Author(s)

Paul Whitfield

Examples

myears <- c(1900:2045)
myears <- ch_sub_set_Years(myears, 20)
myears

a <- LETTERS
my_alpha <- ch_sub_set_Years(a, 5)
my_alpha

[Package CSHShydRology version 1.3.0 Index]