assign_topic: Assign topics based on precalculated scores

Description Usage Arguments Details Value See Also

View source: R/assign_topic.R

Description

Assign topics to abstracts based on precalculated scores.

Usage

1
2
3
4
5
6
7
8
9
assign_topic(
  df,
  col.topic,
  threshold,
  topic.names = NULL,
  col.topic.name = "Topic",
  col.pmid = "PMID",
  discard = FALSE
)

Arguments

df

Data frame containing precalculated topic scores and PubMed-IDs.

col.topic

Character vector. Vector with column names containing precalculated topic scores.

threshold

Integer vector. Vector containing thresholds for topic columns. Positions in threshold correspond to positions in col.topic.

topic.names

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.

col.topic.name

String. Name of the new topic column.

col.pmid

String. Column containing PubMed-IDs.

discard

Boolean. If discard = TRUE, only abstracts with a newly assigned topic are kept. Abstracts without a newly assigned topic are discarded.

Details

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".

Value

Data frame with topics based on precalculated topic scores.

See Also

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()


JulFriedrich/miRetrieve documentation built on Sept. 20, 2021, 11:37 p.m.