Learn R Programming

berryFunctions (version 1.22.5)

monthLabs: Nicely spaced labels along a month

Description

Create dates of certain days of the month for labeling

Usage

monthLabs(startyear = 2002, stopyear = 2018, npm = 2, npy = NA)

Value

Vector with Dates as returned by as.Date.

Arguments

startyear

Integer. starting year. DEFAULT: 2002

stopyear

Integer. ending year. DEFAULT: 2018

npm

Integer, one of 1,2,3,6 or 31. Number of labels per month. DEFAULT: 2
npm : days of the month
1 : first day of each month within the given years
2 : 1st and 15th day
3 : 1, 10, 20
6 : 1, 5, 10, 15, 20, 25. 31 : each day

npy

Integer, one of 1,2,3,4 or 6. Number of labels per year at equally spaced month-beginnings. If specified, npm is not considered at all. DEFAULT: NA

Author

Berry Boessenkool, berry-b@gmx.de, early 2013

See Also

timeAxis for nice labeling, timeAxis for automatic determination of npm/npy, as.Date, paste

Examples

Run this code

monthLabs(2014,2014, 3) # 3 days per month
monthLabs(2013,2014,  npy=3) # 3 months per year, equally spaced
monthLabs(2014,2014,  npy=4) # 4 months per year

# see monthAxis for automatic plot labeling

Run the code above in your browser using DataLab