Description Usage Arguments Details Value Author(s) References Examples
Transform radians to dates in time units (e.g., day of year).
1 | rad2d(r, dpc)
|
r |
A vector of numeric values of angles in radians (representing times/dates) to be converted back to time units. |
dpc |
A numeric value representing the number of divisions per cycle (e.g., hours per day, days per year, etc.) |
rad2d
transforms input values of r
from radians
to dates in the interval [0,dpc+1).
Returns a vector of cyclic dates in the interval [0,dpc+1) having the same length as input vector r.
Bjorn J. Brooks, Danny C. Lee, William W. Hargrove, Lars Y. Pomara
Brooks, B.J., Lee, D.C., Desai, A.R., Pomara, L.Y., Hargrove, W.W. (2017). Quantifying seasonal patterns in disparate environmental variables using the PolarMetrics R package.
1 2 3 4 5 6 | dpy <- 365 # Days/year
data(mndvi) # Load data
t <- as.vector(mndvi$day) # Days since January 1, 2000
r <- t2rad(t, dpc=dpy) # Transform days of year to radians
days_from_rads <- rad2d(r, dpc=dpy) # Transform radians back to days of yr
head(cbind(t, days_from_rads)) # Compare results. Cols should be equiv.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.