# Create an example data frame
dat <- data.frame(citations = c(0, 1, 1, 2, 3, 5, 8),
keywords = c("a; b; c", "b; d", "c", "d", "e; g", "f", "g"),
id = c("abc123", "bcd234", "def345", "efg456", "fgh567", "ghi678", "hij789"),
categories = c("a; d; e", "b", "c", "d; g", "e", "f", "g"))
# Calculate g-type xc-index
xc_index(df = dat, kw = "keywords", cat = "categories", id = "id", cit = "citations", type = "g")
# Calculate h-type xc-index and produce plot
xc_index(df = dat, kw = "keywords", cat = "categories", id = "id", cit = "citations", plot = TRUE)
Run the code above in your browser using DataLab