Description Usage Arguments Details Value Author(s) References Examples
Transform radian values to the nearest corresponding indices of the original data.
1 | rad2idx(r, spc)
|
r |
A vector of numeric values representing dates in radians. |
spc |
A numeric value indicating the number of samples per cycle (e.g., samples per year). |
rad2idx finds the corresponding indices for each element of r.
Returns the index values corresponding to 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 7 | dpy <- 365 # Days/year
spy <- 46 # Samples/year (or samples/cycle)
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
r_idx <- rad2idx(r, spc=spy) # Indices corresponding to radial angles in r
head(cbind(t,r,r_idx)) # Compare results
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.