#' Generate SIT Model Compatible Array
#' @description transforms to array data structure for SIT model input
#' @name create_Sit_array
#' @param input a vector of data, length = 252 for 12 months and 20 years of data
#' @return 3 dimension array [location, month, year]
#' @export
create_SIT_array <- function(input) {
output <- array(NA, dim = c(nrow(input), 12, ncol(input) / 12))
index <- 1
for (i in seq(1, ncol(input), 12)) {
output[ , , index] <- as.matrix(input[ , i:(i + 11)])
index <- index + 1
}
return(output)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.