R/page_compare_contributors.R

#' 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)
    })
  })
  
}
leojoubert/WikiSocio documentation built on May 21, 2019, 5:08 a.m.