R/page_compare_time.R

#' Comparing pages by time distribution of contributions
#'
#' @param meta A list of revisions metadata which each item had been built with \code{page_revisions}
#' @param bindwith A string giving the width of time intervals. Can be either \code{year} or \code{month}.
#' @param mode A string giving the desired output \describe{
#'   \item{plot}{Returning ggplot histograms arranged by the \code{facet_wrap} function.}
#'   \item{data}{Returning a data frame with \code{length(meta)} columns and as much rows as bins.}
#' }
#'
#' @return See \code{mode} parameter.
#' @export
#'

page_compare_time <- function(meta, bindwith, mode) {
  
  if(!bindwith %in% c("year", "month")) {
    
    stop("Please enter 'year' or 'month' as a bindwith.")
    
  }
  
  if(!mode %in% c("plot", "data")) {
    
    stop("Plot can be either 'plot' or 'data'.")
    
  }
  
  # A faire : ggplot histograme mappés ensemble avec facet_wrap
  
}
cafeine05/WikiSocio documentation built on May 13, 2019, 10:39 a.m.