Assign topics to abstracts based on precalculated scores.
assign_topic(
df,
col.topic,
threshold,
topic.names = NULL,
col.topic.name = "Topic",
col.pmid = "PMID",
discard = FALSE
)Data frame containing precalculated topic scores and PubMed-IDs.
Character vector. Vector with column names containing precalculated topic scores.
Integer vector. Vector containing thresholds for topic
columns. Positions in threshold correspond to positions in
col.topic.
Character vector. Optional. Vector containing names of new
topics. Positions in topic.names correspond to positions in
col.topic. If topic.names is not provided, col.topic is used
to name the new topics.
String. Name of the new topic column.
String. Column containing PubMed-IDs.
Boolean. If discard = TRUE, only abstracts with
a newly assigned topic are kept. Abstracts without a newly assigned topic
are discarded.
Data frame with topics based on precalculated topic scores.
Assign topics to abstracts based on precalculated scores.
assign_topic() compares different precalculated topic scores and
assigns the abstract to the topic with the highest score. If there is a
tie between topic scores, the abstract is assigned to all topics in question.
If an abstract matches no topic, it is assigned to the topic "Unknown".
calculate_score_topic(), plot_score_topic(),
add_col_topic()
Other score functions:
calculate_score_animals(),
calculate_score_biomarker(),
calculate_score_patients(),
calculate_score_topic(),
plot_score_animals(),
plot_score_biomarker(),
plot_score_patients(),
plot_score_topic()