An object to query, record and modify an edibble graph
An object to query, record and modify an edibble graph
fct_nodesGet the factor nodes
lvl_nodesGet the level nodes
fct_edgesGet the factor edges
lvl_edgesGet the level edges
fct_nGet the number of nodes in factor graph
lvl_nGet the number of nodes in level graph
rcrd_idsGet the ids for all edbl_rcrd factors.
unit_idsGet the ids for all edbl_unit factors.
trt_idsGet the ids for all edbl_trt factors.
is_connectedCheck if nodes are connected. Get a new factor id. Get a new level id. Given a particular DAG, return a topological order Remember that there could be more than one order.
new()Initialise function
Provenance$new(graph = NULL)graphAn edibble graph.
set_title()Set the title.
Provenance$set_title(title)titleThe title of the experiment
set_name()Set the name.
Provenance$set_name(name)nameThe name of the edibble graph object.
set_validation()Set the validation.
Provenance$set_validation(validation, type = "rcrds")validationThe validation statement.
typeThe type of validation.
set_simulate()Set the simulation process
Provenance$set_simulate(name, process, rcrds)nameThe name of the process
processA function to simulate the record
rcrdsThe record factor name simulating for.
reactivate()Reactivate the graph in the provenance object.
Provenance$reactivate(
design,
overwrite = c("graph", "anatomy", "recipe", "validation", "simulate",
"simualte_result")
)designAn edibble design
overwriteA vector of character to overwrite from the supplied design object.
deactivate()Deactivate the provenance object.
Provenance$deactivate(delete = c("graph", "anatomy", "recipe", "validation"))deleteA vector of character to delete.
fct_id()Get the id based on either the name of the factor node. If none supplied then it will give all.
Provenance$fct_id(name = NULL, role = NULL)nameThe name of the node.
roleThe role for the node.
fct_id_parent()Get the factor parent ids
Provenance$fct_id_parent(id = NULL, role = NULL, type = NULL)idThe id of the corresponding node.
roleThe role for the node.
typeThe type of edge link.
fct_id_child()Get the factor child ids. If role is
supplied then the child has to fit role
Provenance$fct_id_child(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
fct_id_ancestor()Get the factor ancestor ids
Provenance$fct_id_ancestor(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
fct_id_descendant()Get the factor descendant ids
Provenance$fct_id_descendant(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
fct_id_leaves()Get the leave factor ids.
Provenance$fct_id_leaves(role = NULL)roleThe role for the node.
lvl_id()Get the id based on name of level node. Assumes that level ids obtained are all from the same fid
Provenance$lvl_id(value = NULL, role = NULL, fid = NULL)valueThe value of the node.
roleThe role for the node.
fidThe factor id.
lvl_id_parent()Get the level parent ids
Provenance$lvl_id_parent(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
lvl_id_child()Get the level child ids
Provenance$lvl_id_child(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
lvl_id_ancestor()Get the level ancestor ids
Provenance$lvl_id_ancestor(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
fct_id_from_lvl_id()Find the factor id from level ids.
Provenance$fct_id_from_lvl_id(id = NULL, fid_search = NULL)idThe id of the corresponding node.
fid_searchA vector of fids to search from.
fct_id_from_lvl_values()Find the factor id from level values.
Provenance$fct_id_from_lvl_values(value = NULL, fid_search = NULL)valueThe value of the node.
fid_searchA vector of fids to search from.
lvl_id_from_fct_id()Find the level id from the given fid
Provenance$lvl_id_from_fct_id(fid = NULL)fidThe factor id.
fct_names()Get the factor names based on id or role
Provenance$fct_names(id = NULL, role = NULL)idThe id of the corresponding node.
roleThe role for the node.
unit_names()Get the unit names
Provenance$unit_names(id = NULL)idThe id of the corresponding node.
trt_names()Get the treatment names
Provenance$trt_names(id = NULL)idThe id of the corresponding node.
rcrd_names()Get the record names.
Provenance$rcrd_names(id = NULL)idThe id of the corresponding node.
rcrd_class()Get the class for record with validation.
Provenance$rcrd_class(name = NULL)nameThe name of the node.
lvl_values()Get the level values based on id or role cannot have just role only defined. id must be from the same fid
Provenance$lvl_values(id = NULL, role = NULL, fid = NULL)idThe id of the corresponding node.
roleThe role for the node.
fidThe factor id.
unit_values()Get the unit values.
Provenance$unit_values(id = NULL, fid = NULL)idThe id of the corresponding node.
fidThe factor id.
trt_values()Get the treatment values.
Provenance$trt_values(id = NULL, fid = NULL)idThe id of the corresponding node.
fidThe factor id.
rcrd_values()Get the record values.
Provenance$rcrd_values(uid = NULL, fid = NULL)uidThe unit level id
fidThe factor id.
fct_role()Get the role of the vertex given the factor id
Provenance$fct_role(id = NULL)idThe id of the corresponding node.
fct_levels()Get the levels for each factor
Provenance$fct_levels(id = NULL, name = NULL, return = c("id", "value"))idThe id of the corresponding node.
nameThe name of the node.
returnTo return in "id" or "value" format.
fct_levels_id_to_edbl_fct()Factor levels to edble factor
Provenance$fct_levels_id_to_edbl_fct(fct_levels, role)fct_levelsThe factor levels in id.
roleThe role for the node.
fct_levels_id_to_value()Get the factor levels in value given id format
Provenance$fct_levels_id_to_value(fct_levels)fct_levelsA list of factor levels in id format.
fct_levels_value_to_id()Get the factor levels in id given value format.
Provenance$fct_levels_value_to_id(fct_levels)fct_levelsA list of factor levels in id format.
fct_exists()One of name, id or role is defined to check if it exists.
If more than one of the arguments name, id and role are supplied, then
the intersection of it will be checked.
Provenance$fct_exists(id = NULL, name = NULL, role = NULL, abort = TRUE)idThe id of the corresponding node.
nameThe name of the node.
roleThe role for the node.
abortWhether to abort.
trt_exists()Check if treatment exists.
Provenance$trt_exists(id = NULL, name = NULL, abort = TRUE)idThe id of the corresponding node.
nameThe name of the node.
abortWhether to abort.
unit_exists()Check if unit exists.
Provenance$unit_exists(id = NULL, name = NULL, abort = TRUE)idThe id of the corresponding node.
nameThe name of the node.
abortWhether to abort.
rcrd_exists()Check if record exists.
Provenance$rcrd_exists(id = NULL, name = NULL, abort = TRUE)idThe id of the corresponding node.
nameThe name of the node.
abortWhether to abort.
append_fct_nodes()Given node data, append the factor nodes
Provenance$append_fct_nodes(name, role, attrs = NULL)nameThe name of the node.
roleThe role for the node.
attrsThe attributes.
append_lvl_nodes()Given node data, append the level nodes
Provenance$append_lvl_nodes(
value,
n = NULL,
label = NULL,
attrs = NULL,
fid = NULL
)valueThe value of the node.
nThe number of replications.
labelThe labels for the levels.
attrsThe attributes.
fidThe factor id.
append_fct_edges()Given edge data, append the factor edges
Provenance$append_fct_edges(from, to, type = NULL, group = FALSE, attrs = NULL)fromThe node id from.
toThe node id to.
typeThe type of edges.
groupA logical value to indicate whether to create new group id or not.
attrsThe attributes.
append_lvl_edges()Given edge data, append the level edges
Provenance$append_lvl_edges(from, to, attrs = NULL)fromThe node id from.
toThe node id to.
attrsThe attributes.
serve_units()Serve the units.
Provenance$serve_units(id = NULL, return = c("id", "value"))idThe id of the corresponding node.
returnTo return in "id" or "value" format.
serve_trts()Serve treatments
Provenance$serve_trts(id = NULL, return = c("id", "value"))idThe id of the corresponding node.
returnTo return in "id" or "value" format.
serve_rcrds()Serve records
Provenance$serve_rcrds(id = NULL, return = c("id", "value"))idThe id of the corresponding node.
returnTo return in "id" or "value" format.
make_trts_table()Make the treatments table
Provenance$make_trts_table(id = NULL, return = c("id", "value"))idThe id of the corresponding node.
returnTo return in "id" or "value" format.
A treatment table
graph_subset()Subset graph
Provenance$graph_subset(
id = NULL,
include = c("self", "child", "parent", "ancestors")
)idThe id of the corresponding node.
include"self" for only input id, "child" for child also, "parent" for parent also, nodes immediately related, and "ancestors" for all ancestors
subsetted graph
save_seed()Save the seed
Provenance$save_seed(seed, type)seedA seed.
typeType.
get_title()Get the title
Provenance$get_title()
get_validation()Get the validation
Provenance$get_validation(type = NULL)typeA type.
get_trail()Get the trail.
Provenance$get_trail()
get_graph()Get the graph
Provenance$get_graph()
get_seed()Get the seed
Provenance$get_seed()
get_session_info()Get the session information
Provenance$get_session_info()
get_edibble_version()Get the edibble version.
Provenance$get_edibble_version()
get_simulate()Get the simulation information
Provenance$get_simulate(name = NULL)nameThe process name. Only one name allowed.
get_simulate_result_env()Get the simulation results
Provenance$get_simulate_result_env(name = NULL)nameThe process name. Only one name allowed.
mapping()Mapping of a role to role
Provenance$mapping(role_from, role_to)role_fromThe role from.
role_toThe role to.
mapping_to_unit()Mapping of an id to a unit
Provenance$mapping_to_unit(id = NULL)idThe id of the corresponding node.
record_step()Record step.
Provenance$record_step()
lvl_mapping()Get the level edges by factor
Provenance$lvl_mapping(from, to, return = c("vector", "table"))from, toThe factor id.
returnTo return in "id" or "value" format.
record_track_external()Record track external.
Provenance$record_track_external(code)codeThe code to record.
fct_id_links()Find all id that is linked.
Provenance$fct_id_links(id = NULL, role = NULL, link = c("direct", "indirect"))idThe id of the corresponding node.
roleThe role for the node.
linkWhether the link should be direct or indirect
id of linked factors, excluding itself.
fct_graph_components()Get the nodes with components (subgraph number)
Provenance$fct_graph_components(id = NULL)idThe id of the corresponding node.
lvl_graph_components()Get the nodes with components (subgraph number)
Provenance$lvl_graph_components()
clone()The objects of this class are cloneable with this method.
Provenance$clone(deep = FALSE)deepWhether to make a deep clone.
The Provenance contains a set of operations to manipulate the nodes and edges of the edibble graph object.