joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
220 stars 71 forks source link

Documentation - errors in details section of plot.xts.Rd does not reflect match.arg values for ticks #291

Closed harvey131 closed 5 years ago

harvey131 commented 5 years ago

plot.xts.Rd documentation is incorrect in 'details' section. It says possible values to 'major.ticks', etc.. can be named 'yearly' but the axTicksByTime() looks for values named 'years', not 'yearly'.

\details{
  Possible values for arguments \code{major.ticks}, \code{minor.ticks},
  and \code{grid.ticks.on} include \sQuote{auto}, \sQuote{minute},
  \sQuote{hourly}, \sQuote{daily}, \sQuote{weekly}, \sQuote{monthly},
  \sQuote{quarterly}, and \sQuote{yearly}. The default is \sQuote{auto}, which
  attempts to determine sensible locations from the periodicity and locations
  of observations. The other values are based on the output from
  \code{periodicity}.
}

Please change documentation to use the same values in axTicksByTime():

tick.opts <- c("years", "quarters", "months", "weeks", "days", "hours", "minutes", "seconds")

Updated version:

\details{
  Possible values for arguments \code{major.ticks}, \code{minor.ticks},
  and \code{grid.ticks.on} include \sQuote{auto}, \sQuote{minutes},
  \sQuote{hours}, \sQuote{days}, \sQuote{weeks}, \sQuote{months},
  \sQuote{quarters}, and \sQuote{years}. The default is \sQuote{auto}, which
  attempts to determine sensible locations from the periodicity and locations
  of observations. The other values are based on the output from
  \code{periodicity}.
}
joshuaulrich commented 5 years ago

Thanks for the report! I agree the documentation should be corrected. We also need to update the Details section that says the "ticks" argument values are based on the output of periodicity(). The periodicity() output uses the "*ly" versions.

Ideally, we should be consistent and use one or the other (i.e "hours" or "hourly") everywhere.