diff --git a/R/fortify.R b/R/fortify.R index 54f01c0..dc8a898 100644 --- a/R/fortify.R +++ b/R/fortify.R @@ -45,38 +45,3 @@ fortify.periodic_df <- function(model, data, ...) { } } - -#' #' @importFrom ggplot2 ggplot_add -#' #' @export -#' ggplot_add.periodic_layer <- function(object, plot, object_name) { -#' gr <- as.character(object$layer$mapping$group)[2] -#' if (!is.null(object$layer$data) & !is.waive(object$layer$data)) { -#' # If data is defined for this layer -#' if (!is.periodic(object$layer$data)) { -#' object$layer$data <- do.call(periodic, c(list(object = object$layer$data), -#' object$cols)) -#' } -#' if (is.periodic(object$layer$data)) { -#' object$layer$data <- do.call(wrap, c(list(object = object$layer$data, -#' .group = gr), -#' object$cols)) -#' } -#' -#' } else { -#' # If data comes from plot -#' if (!is.periodic(plot$data)) { -#' if (!isTRUE(attr(plot$data, "wrapped"))) { -#' # If is not a wrapped periodic dataframe -#' object$layer$data <- do.call(periodic, c(list(object = plot$data), object$cols)) -#' } -#' } -#' if (is.periodic(object$layer$data)) { -#' object$layer$data <- do.call(wrap, c(list(object = object$layer$data, -#' .group = gr), -#' object$cols)) -#' } -#' } -#' -#' plot$layers <- append(plot$layers, object$layer) -#' plot -#' } \ No newline at end of file diff --git a/R/periodic.R b/R/periodic.R index 7f6736e..5930a88 100644 --- a/R/periodic.R +++ b/R/periodic.R @@ -99,7 +99,6 @@ periodic.data.frame <- function(object, ...) { data.table::setattr(object[[names(cols)[i]]], "period", period) if (!inherits(object[[names(cols)[i]]], "sticky")) { data.table::setattr(object[[names(cols)[i]]], "class", c("sticky", class(object[[names(cols)[i]]]))) - # class(object[[names(cols)[i]]]) <- c("sticky", class(object[[names(cols)[i]]])) } } }