View source: R/Rule_building.R
| rules_to_query | R Documentation |
The rules produced by extract_rules() and modified by the other tools in
the framework are in a format ready for using as boolean filtering tools in
R, for example by using eval(str2expression(rule))). To be used online
with citation database they need to be converted in another format.
rules_to_query(rules)
rules |
A vector of rules. |
A string with the rules joined and transformed into a format ready for online use.
rules <- c(
'V__network._.patient %in% "1" & V__patient_transport %in% "1" &
V__transmission %in% "1" & V__personnel %in% "0" & V__therapy %in% "0"',
'V__Donker_T %in% "1" & V__bacterium_isolate %in% "0" & V__able %in% "0"',
'V__network._.patient %in% "1" & V__resistant_staphylococcus_aureus %in% "1"
& V__carlo.monte.carlo._.monte %in% "0"'
)
new_query <- rules_to_query(rules)
## Not run:
# Produce a new query from a rule review file:
candidate_queries <- readRDS(file.path("Sessions", "Session1", "rule_data.rds"))
Target <- candidate_queries$DTM$Target
SpecificDTM <- candidate_queries$SpecificDTM
simplified_rules <- file.path(
"Sessions", "Session1",
"Selected_rules_reviewed.xlsx"
) %>%
import_data() %>%
simplify_ruleset(target_vec = Target, target_data = SpecificDTM) %>%
pull(rule)
new_query <- rules_to_query(simplified_rules)
writeLines(rules_to_query, file.path("Sessions", "Session1", "Resulting_query.txt"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.