View source: R/get_query_types.R
get_query_types | R Documentation |
Find which nodal or causal types are satisfied by a query.
get_query_types(model, query, map = "causal_type", join_by = "|")
model |
A |
query |
A character string. An expression defining nodal types to
interrogate |
map |
Types in query. Either |
join_by |
A logical operator. Used to connect causal statements: AND ('&') or OR ('|'). Defaults to '|'. |
A list containing some of the following elements
types |
A named vector with logical values indicating whether a
|
query |
A character string as specified by the user |
expanded_query |
A character string with the expanded query. Only differs from ‘query' if this contains wildcard ’.' |
evaluated_nodes |
Value that the nodes take given a query |
node |
A character string of the node whose nodal types are being queried |
type_list |
List of causal types satisfied by a query |
model <- make_model('X -> M -> Y; X->Y')
query <- '(Y[X=0] > Y[X=1])'
get_query_types(model, query, map="nodal_type")
get_query_types(model, query, map="causal_type")
get_query_types(model, query)
# Examples with map = "nodal_type"
query <- '(Y[X=0, M = .] > Y[X=1, M = 0])'
get_query_types(model, query, map="nodal_type")
query <- '(Y[] == 1)'
get_query_types(model, query, map="nodal_type")
get_query_types(model, query, map="nodal_type", join_by = '&')
# Root nodes specified with []
get_query_types(model, '(X[] == 1)', map="nodal_type")
query <- '(M[X=1] == M[X=0])'
get_query_types(model, query, map="nodal_type")
# Nested do operations
get_query_types(
model = make_model('A -> B -> C -> D'),
query = '(D[C=C[B=B[A=1]], A=0] > D[C=C[B=B[A=0]], A=0])')
# Helpers
model <- make_model('M->Y; X->Y')
query <- complements('X', 'M', 'Y')
get_query_types(model, query, map="nodal_type")
# Examples with map = "causal_type"
model <- make_model('X -> M -> Y; X->Y')
query <- 'Y[M=M[X=0], X=1]==1'
get_query_types(model, query, map= "causal_type")
query <- '(Y[X = 1, M = 1] > Y[X = 0, M = 1]) &
(Y[X = 1, M = 0] > Y[X = 0, M = 0])'
get_query_types(model, query, "causal_type")
query <- 'Y[X=1] == Y[X=0]'
get_query_types(model, query, "causal_type")
query <- '(X == 1) & (M==1) & (Y ==1) & (Y[X=0] ==1)'
get_query_types(model, query, "causal_type")
query <- '(Y[X = .]==1)'
get_query_types(model, query, "causal_type")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.