Skip to contents

This function identifies and analyzes groups (communities) within scientific networks created from articles and patents data. It can apply different clustering algorithms to detect technological trajectories and emerging scientific fields.

Usage

sniff_groups(
  comps,
  min_group_size = 10,
  keep_component = c("component1"),
  cluster_component = c("component1"),
  algorithm = "fast_greedy",
  groups_short_name = FALSE
)

Arguments

comps

A list containing network components, typically generated by sniff_components(). Must include a network object with 'component' and 'PY' (publication year) vertex attributes.

min_group_size

Minimum size for a group to be included in results (default = 10). Groups with fewer members will be filtered out.

keep_component

Character vector specifying which network components to process (default = "component1"). Can include multiple components.

cluster_component

Character vector specifying which components should be clustered (default = "component1"). Components not listed here will be treated as single groups.

algorithm

Community detection algorithm to use (default = "fast_greedy"). Options include: "louvain", "walktrap", "edge_betweenness", "fast_greedy", or "leiden".

groups_short_name

Logical indicating whether to use short group names (default = FALSE). If TRUE, removes component prefixes from group names.

Value

A list with three elements:

  • aggregate: A data frame with group statistics including group name, number of papers, and average publication year

  • network: The input network with added group attributes

  • pubs_by_year: Publication counts by group and year

Details

The function first validates the input network, then applies the specified clustering algorithm to detect communities within the network. It calculates statistics for each detected group and returns the results along with the augmented network. The function can handle multiple network components simultaneously, applying clustering only to specified components.

See also

sniff_components() for creating the input network components

Examples

if (FALSE) { # \dontrun{
# Assuming 'comps' is output from sniff_components()
groups <- sniff_groups(comps,
  min_group_size = 15,
  algorithm = "leiden",
  groups_short_name = TRUE
)

# Access group statistics
groups$aggregate
groups$network
groups$pubs_by_year
} # }