xd_index | R Documentation |
This is a standalone function that specifically calculates the xd-index for an institution using bibliometric data from an edge list, with an optional plot visualisation. The function is suitable for including inside loops when plotting parameter is set to "FALSE" or "F".
xd_index(df, cat, id, cit, type = "h", dlm = ";", plot = FALSE)
df |
Data frame object containing bibliometric data. This data frame must have at least three columns: one for categories, one for unique IDs, and one for citation counts. Each row in the data frame should represent a document or publication. |
cat |
Character string specifying the name of the column in "df" that contains categories. Each cell in this column may contain no categories (missing), a single category or multiple categories separated by a specified delimiter. |
id |
Character string specifying the name of the column in "df" that contains unique identifiers for each document. Each cell in this column must contain a single ID (unless missing) and not multiple IDs. |
cit |
Character string specifying the name of the column in "df" that contains the number of citations each document has received. Citations must be represented as integers. Each cell in this column should contain a single integer value (unless missing) representing the citation count for the corresponding document. |
type |
"h" for Hirsch's h-type index or "g" for Egghe's g-type index. Default set to "h". |
dlm |
Character string specifying the delimiter used in the "cat" column to separate multiple categories within a single cell. The delimiter should be consistent across the entire "cat" column. Common delimiters include ";", "/", ":", and ",". The default delimiter is set to ";". |
plot |
Logical value indicating whether to generate and display a plot of the xd-index calculation. Set to "TRUE" or "T" to generate the plot, and "FALSE" or "F" to skip plot generation. The default is "FALSE". |
xd-index value and plot for institution.
# 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 xd-index
xd_index(df = dat1, cat = "categories", 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 xd-index
xd_index(df = dat2, cat = "categories", 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 xd-index and produce plot
xd_index(df = dat3, cat = "categories", id = "id", cit = "citations", dlm = ":", plot = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.