R/util.R

Defines functions index_attributes make_dummy_dispatch_obj remove_time_group make_time_formula

# Reexports --------------------------------------------------------------------

#' @importFrom magrittr %>%
#' @export
#'
magrittr::`%>%`

#' @importFrom rlang :=
#'
NULL

#' @importFrom rlang .data
#'
NULL

#' @importFrom rlang %||%
#'
NULL

#' @useDynLib tibbletime3
#' @importFrom Rcpp sourceCpp
NULL

# Global util ------------------------------------------------------------------

index_attributes <- function() {
  c("index_quo", "index_time_zone")
}

make_dummy_dispatch_obj <- function(x) {
  structure(list(), class = x)
}

remove_time_group <- function(x) {
  if(".time_group" %in% colnames(x)) {
    x[[".time_group"]] <- NULL
  }
  x
}

make_time_formula <- function(lhs = NULL, rhs) {
  lhs <- validate_side(lhs)
  rhs <- validate_side(rhs)
  formula(paste0(lhs, "~", rhs))
}
DavisVaughan/tibbletime3 documentation built on May 28, 2019, 12:25 p.m.