#' Is all
#'
#' TRUE IFF all arguments meet condition, specific to time frame function
#'
#' @param f a list
#' @param ... additional param
#'
#' @return TRUE IFF all arguments meet condition
is_all_ = function(f, ...) {
for (y in list(...))
if (!isTRUE(f(y)))
return(FALSE)
return(TRUE)
}
#' Is all null
#'
#' TRUE IFF all arguments are NULL, specific to time frame function
#'
#' @param ... additional param
#'
#' @return TRUE IFF all arguments are NUL
is_all_null = function(...) {
return(is_all_(is.null, ...))
}
#' Check if all arguments are equal length
#'
#' @param ... additional param
#' @return TRUE IFF all arguments are equal length
is_all_equal_length = function(...) {
if (length(list(...)) == 0)
return(FALSE)
l = list(...) %>% `[[`(1) %>% length
f = function(x) length(x) == l
return(is_all_(f, ...))
}
is_varying_length = function(...) !is_all_equal_length(...)
is_odd_length = function(x) (length(x) %% 2) == 1
is_even_length = function(x) (length(x) %% 2) == 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.