Learn R Programming

SportMiner (version 0.1.0)

sm_keyword_network: Create Keyword Co-occurrence Network

Description

Generates and visualizes a keyword co-occurrence network from author-provided keywords. Shows which keywords frequently appear together in the same papers.

Usage

sm_keyword_network(
  data,
  keyword_col = "author_keywords",
  separator = "; ",
  min_cooccurrence = 2,
  top_n = 30,
  layout = "fr"
)

Value

A ggraph/ggplot object displaying the keyword network.

Arguments

data

Data frame containing papers with keyword information.

keyword_col

Name of the column containing keywords. Default is "author_keywords".

separator

Character string separating keywords within a cell. Default is "; " (Scopus format).

min_cooccurrence

Minimum number of times keywords must co-occur to be included in the network. Default is 2.

top_n

Number of top keywords (by frequency) to include. If NULL, includes all keywords meeting min_cooccurrence. Default is 30.

layout

Network layout algorithm. Options include "fr" (Fruchterman-Reingold), "kk" (Kamada-Kawai), "circle". Default is "fr".

Examples

Run this code
if (FALSE) {
# Requires API data from sm_search_scopus()
papers <- sm_search_scopus(query, max_count = 100)
network_plot <- sm_keyword_network(papers, top_n = 25)
print(network_plot)
}

Run the code above in your browser using DataLab