# DaillyAno() examples

DailyAno()
DailyAno(data = NULL)
DailyAno(data = 0)
DailyAno(data = NULL, jdays = NULL)
DailyAno(data = 0, jdays = NULL)
DailyAno(data = 0, jdays = 0)
DailyAno(data = 0, jdays = 0, na.rm = TRUE)
DailyAno(data = 0, jdays = 0, na.rm = FALSE)
DailyAno(data = NA, jdays = 0, na.rm = TRUE)
DailyAno(data = NA, jdays = 0, na.rm = FALSE)

data <- 1:10
jdays <- c(rep(1, 5), rep(2, 5))
DailyAno(data = data, jdays = jdays, na.rm = TRUE)
data[4] <- NA
data
DailyAno(data = data, jdays = jdays, na.rm = TRUE)
DailyAno(data = data, jdays = jdays, na.rm = FALSE)

data <- 1 : 10
time = sort(c(seq(ISOdate(1900, 1, 1), ISOdate(1904, 1, 1), "year"), 
              seq(ISOdate(1900, 1, 2), ISOdate(1904, 1, 2), "year")))
metadata <- list(time = list(standard_name = 'time', long_name = 'time', 
                             calendar = 'standard',
                             units = 'days since 1970-01-01 00:00:00', prec = 'double', 
                             dim = list(list(name ='time', unlim = FALSE))))
attr(time, "variables") <- metadata
DailyAno(data = data, dates = time, jdays = NULL, na.rm = TRUE)
DailyAno(data = data, dates = time, jdays = NULL, na.rm = FALSE)
data[4] <- NA
DailyAno(data = data, dates = time, jdays = NULL, na.rm = TRUE)
DailyAno(data = data, dates = time, jdays = NULL, na.rm = FALSE)

data <- 1 : 10
time = sort(c(seq(ISOdate(1900, 1, 1), ISOdate(1905, 1, 1), "year"), 
              seq(ISOdate(1900, 1, 2), ISOdate(1905, 1, 2), "year")))
metadata <- list(time = list(standard_name = 'time', long_name = 'time', 
                             calendar = 'standard',
                             units = 'days since 1970-01-01 00:00:00', prec = 'double', 
                             dim = list(list(name ='time', unlim = FALSE))))
attr(time, "variables") <- metadata
DailyAno(data = data, dates = time, jdays = NULL, na.rm = TRUE) # Error Correct

