# Create an example data frame
dat1 <- 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 h-type x-index
x_index(df = dat1, kw = "keywords", id = "id", cit = "citations")
# Create another example data frame
dat2 <- 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("123", "234", "345", "456", "567", "678", "789"),
categories = c("a/ d/ e", "b", "c", "d/ g", "e", "f", "g"))
# Calculate g-type x-index
x_index(df = dat2, kw = "keywords", id = "id", cit = "citations", type = "g", dlm = "/")
# Create another example data frame
dat3 <- 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(123, 234, 345, 456, 567, 678, 789),
categories = c("a: d: e", "b", "c", "d: g", "e", "f", "g"))
# Calculate h-type x-index and produce plot
x_index(df = dat3, kw = "keywords", id = "id", cit = "citations", dlm = ",", plot = TRUE)
Run the code above in your browser using DataLab