Converts an icites data.table into a tidy graph representation
(nodes + edges) suitable for igraph or tidygraph. Only edges
where both endpoints are present in the corpus are retained, so the
graph is bounded to the papers you already have metadata for.
citation_network(icites)A data.table returned by
get_records(endpoint = "icites"). Must contain pmid
and citation_net columns.
A named list with two data.tables:
nodesOne row per PMID. Contains all iCite metadata
columns except citation_net. Key columns: pmid,
relative_citation_ratio, nih_percentile,
is_clinical.
edgesOne row per within-corpus directed citation.
Columns: from_pmid (the citing paper),
to_pmid (the cited paper).
RCR and is_clinical are carried as node attributes, making the
resulting graph immediately weighted by field-normalized impact and enabling
bench-to-bedside edge filtering without any additional API calls.
if (FALSE) { # \dontrun{
# network from a seed corpus
pmids |>
get_records(endpoint = "icites") |>
citation_network()
# expand first, then fetch iCite metadata for the full network
snowball <- pmids |>
get_records(endpoint = "icites") |>
citation_snowball()
snowball$pmid |>
get_records(endpoint = "icites") |>
citation_network()
# translational footprint: filter to bench -> clinical edges
snowball <- pmids |>
get_records(endpoint = "icites") |>
citation_snowball()
net <- snowball$pmid |>
get_records(endpoint = "icites") |>
citation_network()
clinical_edges <- net$edges |>
merge(net$nodes[, .(pmid, is_clinical)],
by.x = "to_pmid", by.y = "pmid") |>
subset(is_clinical == TRUE)
} # }