View source: R/cloud_ind_MCH.R
| climdex.cloud.CCge4 | R Documentation | 
This function was originally written to calculate CCge4; the fraction of sunny/cloudy days which are within at least 4 consecutive day periods. Sunny days were defined as daily average cloud covers < 3 okta and cloudy days as daily average cloud covers >= 6 okta.
climdex.cloud.CCge4(ci, freq, threshold, op, n)
ci | 
 Object of type climdexInput.  | 
freq | 
 Time frequency/period to aggregate to.  | 
op | 
 Operator that compares cloud.okta with threshold.  | 
n | 
 Maximum number of spell lenghts that should be skipped.  | 
thresh | 
 Threshold value  | 
for each date.factor the fraction of days which are whithin at least n+1 consecutive days which are op threshold.
# example date.series
date.series <- seq(as.POSIXct("2017/01/01", tz="UTC"), as.POSIXct("2017/12/31", tz = "UTC"), by = "day")
# example cloud.okta
sam <- rep(c(runif(300,0,3),runif(10,3,6), runif(500,6,8)), 1000)
cloud.okta <- sample(sam,length(date.series))
# climdexInput object
ci <- climind::climdexInput.raw(cloud = cloud.okta,
                                     cloud.dates = PCICt::as.PCICt.POSIXct(date.series, cal="gregorian"))
# CCge4 Index
CCge4.2 <- climdex.cloud.CCge4(ci = ci, freq = "seasonal", threshold = 3, op = "<", n = 3)
CCge4.6 <- climdex.cloud.CCge4(ci = ci, freq = "seasonal", threshold = 6, op = ">=", n = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.