ndays {quantmod} | R Documentation |
Calculate the number of specified periods in a given time series like data object.
nseconds(x) nminutes(x) nhours(x) ndays(x) nweekdays(x) nweeks(x) nmonths(x) nquarters(x) nyears(x)
x |
A vector inheriting from POSIXt or Date, or a zoo object indexed by such vector |
Essentially a wrapper to breakpoints
with the appropriate
period specified; the resulting value derived from counting the
breaks.
As a compromise between simplicity and accuracy, the results will always round up to the nearest complete period. So n**** - 1 will return the completed periods.
For finer grain detail one should call a higher frequency n**** function.
An alternative summary can be found with periodicity
and unclass(periodicity(x))
.
The number of observations for the period type specified
Jeffrey A. Ryan
## Not run: getSymbols("QQQQ") ndays(QQQQ) nweeks(QQQQ) ## End(Not run)