Skip to content

Commit

Permalink
Finalize 'metrics.centrality' function
Browse files Browse the repository at this point in the history
Sort entries of resulting data frame and check whether the new default value
(that is computing the data.source directly from the network relations)
should be used or not.

See se-sic#195
  • Loading branch information
nlschn committed Feb 24, 2021
1 parent 7fd7e1f commit 8198517
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions util-networks.R
Original file line number Diff line number Diff line change
Expand Up @@ -1610,3 +1610,24 @@ get.sample.network = function() {

return(network)
}


## / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /
## Helper functions---------------------------------------------------------

#' Calculate the data sources of a network based on its edge relations and compute all authors from these
#'
#' @param proj.data the \code{Proj.Data} object corresponding to the network
#' @param network the network with the relations to be extracted
#' @return a list of authors from the data sources of the relations in the network
relations.to.authors = function(proj.data, network) {
## get all relations in the network
data.sources = unique(E(net)$relation)

## map them to data sources respectively using the defined translation constant
data.sources = apply(data.sources, 2, function(relation) {
return(RELATION.TO.DATASOURCE[relation])
})

return(get.authors.by.data.source(data.sources))
}

0 comments on commit 8198517

Please sign in to comment.