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