R/page_compare_contributors.R

Defines functions page_compare_contributors

Documented in page_compare_contributors

#' Comparing contributors population of two pages.
#'
#' @param meta A list of revisions metadata which each item had been built with \code{page_revisions}
#'
#' @return A matrix X of dimensions \code{length(meta)^2}, where the value X(i;j) is the percent of contributors of page i which are also contributors of page j.
#' @export
#' 

page_compare_contributors <- function(meta) {
  
  ldply(meta, function(x) {
    sapply(meta, function(y) {
      match(x$user, y$user) %>% .[!is.na(.)] %>% length(.) / length(x$user)
    })
  })
  
}
cafeine05/WikiSocio documentation built on Nov. 17, 2018, 10:01 a.m.