GetUnitText | R Documentation |
This is an internal function called by some plot()
methods. Considering the time series 'units' attribute and the frequency of the observations in the series, the function returns a string with a pertinent time unit. For instance, if the unit is 'years' and the frequency is 12, then data are monthly sampled and GetUnitText()
returns the string "months"
GetUnitText(series)
series |
a regular time series (a 'rts' object in Splus, or a 'ts' object in R) |
a string with the best time unit for graphs
Philippe Grosjean (phgrosjean@sciviews.org), Fr?d?ric Ibanez (ibanez@obs-vlfr.fr)
daystoyears
, yearstodays
timeser <- ts(1:24, frequency=12) # 12 observations per year
attr(timeser, "units") <- "years" # time in years for 'ts' object
GetUnitText(timeser) # formats unit (1/12 year=months)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.