score_rule: Mining herb-herb associations with Apriori

View source: R/score_rule.R

score_ruleR Documentation

Mining herb-herb associations with Apriori

Description

Mine herb-herb association rules of prescription using the Apriori algorithm.

Usage

score_rule(BasicData, drug = NULL, support = 0.1, confidence = 0.8)

Arguments

BasicData

BasicData object.

drug

Charactor vector of drug names to analyze, default to NULL.

support

A numeric value for the minimal support of an item set, default to 0.1.

confidence

A numeric value for the minimal confidence of an item set, default to 0.8.

Value

A HerbResult object.

Author(s)

Yuanlong Hu

Examples

## Not run: 
data(drugdemo)
drug_herb <- PrepareData(drugdemo$drug_herb, from = "drug", to="herb")
herb_compound <- PrepareData(drugdemo$herb_compound, from = "herb", to="compound")
compound_target <- PrepareData(drugdemo$compound_target, from = "compound", to="target")
disease <- PrepareData(drugdemo$disease, diseaseID = "disease",from = "target", to="target")
BasicData <- CreateBasicData(drug_herb, herb_compound, compound_target, diseasenet = disease)
res <- score_rule(BasicData, support = 0.1,confidence = 0.8)

## End(Not run)

immcp documentation built on May 12, 2022, 9:05 a.m.