An object to query, record and modify an edibble graph
An object to query, record and modify an edibble graph
fct_nodes
Get the factor nodes
lvl_nodes
Get the level nodes
fct_edges
Get the factor edges
lvl_edges
Get the level edges
fct_n
Get the number of nodes in factor graph
lvl_n
Get the number of nodes in level graph
rcrd_ids
Get the ids for all edbl_rcrd factors.
unit_ids
Get the ids for all edbl_unit factors.
trt_ids
Get the ids for all edbl_trt factors.
is_connected
Check 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)
graph
An edibble graph.
set_title()
Set the title.
Provenance$set_title(title)
title
The title of the experiment
set_name()
Set the name.
Provenance$set_name(name)
name
The name of the edibble graph object.
set_validation()
Set the validation.
Provenance$set_validation(validation, type = "rcrds")
validation
The validation statement.
type
The type of validation.
set_simulate()
Set the simulation process
Provenance$set_simulate(name, process, rcrds)
name
The name of the process
process
A function to simulate the record
rcrds
The 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")
)
design
An edibble design
overwrite
A vector of character to overwrite from the supplied design object.
deactivate()
Deactivate the provenance object.
Provenance$deactivate(delete = c("graph", "anatomy", "recipe", "validation"))
delete
A 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)
name
The name of the node.
role
The role for the node.
fct_id_parent()
Get the factor parent ids
Provenance$fct_id_parent(id = NULL, role = NULL, type = NULL)
id
The id of the corresponding node.
role
The role for the node.
type
The 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)
id
The id of the corresponding node.
role
The role for the node.
fct_id_ancestor()
Get the factor ancestor ids
Provenance$fct_id_ancestor(id = NULL, role = NULL)
id
The id of the corresponding node.
role
The role for the node.
fct_id_descendant()
Get the factor descendant ids
Provenance$fct_id_descendant(id = NULL, role = NULL)
id
The id of the corresponding node.
role
The role for the node.
fct_id_leaves()
Get the leave factor ids.
Provenance$fct_id_leaves(role = NULL)
role
The 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)
value
The value of the node.
role
The role for the node.
fid
The factor id.
lvl_id_parent()
Get the level parent ids
Provenance$lvl_id_parent(id = NULL, role = NULL)
id
The id of the corresponding node.
role
The role for the node.
lvl_id_child()
Get the level child ids
Provenance$lvl_id_child(id = NULL, role = NULL)
id
The id of the corresponding node.
role
The role for the node.
lvl_id_ancestor()
Get the level ancestor ids
Provenance$lvl_id_ancestor(id = NULL, role = NULL)
id
The id of the corresponding node.
role
The 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)
id
The id of the corresponding node.
fid_search
A 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)
value
The value of the node.
fid_search
A 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)
fid
The factor id.
fct_names()
Get the factor names based on id or role
Provenance$fct_names(id = NULL, role = NULL)
id
The id of the corresponding node.
role
The role for the node.
unit_names()
Get the unit names
Provenance$unit_names(id = NULL)
id
The id of the corresponding node.
trt_names()
Get the treatment names
Provenance$trt_names(id = NULL)
id
The id of the corresponding node.
rcrd_names()
Get the record names.
Provenance$rcrd_names(id = NULL)
id
The id of the corresponding node.
rcrd_class()
Get the class for record with validation.
Provenance$rcrd_class(name = NULL)
name
The 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)
id
The id of the corresponding node.
role
The role for the node.
fid
The factor id.
unit_values()
Get the unit values.
Provenance$unit_values(id = NULL, fid = NULL)
id
The id of the corresponding node.
fid
The factor id.
trt_values()
Get the treatment values.
Provenance$trt_values(id = NULL, fid = NULL)
id
The id of the corresponding node.
fid
The factor id.
rcrd_values()
Get the record values.
Provenance$rcrd_values(uid = NULL, fid = NULL)
uid
The unit level id
fid
The factor id.
fct_role()
Get the role of the vertex given the factor id
Provenance$fct_role(id = NULL)
id
The id of the corresponding node.
fct_levels()
Get the levels for each factor
Provenance$fct_levels(id = NULL, name = NULL, return = c("id", "value"))
id
The id of the corresponding node.
name
The name of the node.
return
To 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_levels
The factor levels in id.
role
The 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_levels
A 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_levels
A 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)
id
The id of the corresponding node.
name
The name of the node.
role
The role for the node.
abort
Whether to abort.
trt_exists()
Check if treatment exists.
Provenance$trt_exists(id = NULL, name = NULL, abort = TRUE)
id
The id of the corresponding node.
name
The name of the node.
abort
Whether to abort.
unit_exists()
Check if unit exists.
Provenance$unit_exists(id = NULL, name = NULL, abort = TRUE)
id
The id of the corresponding node.
name
The name of the node.
abort
Whether to abort.
rcrd_exists()
Check if record exists.
Provenance$rcrd_exists(id = NULL, name = NULL, abort = TRUE)
id
The id of the corresponding node.
name
The name of the node.
abort
Whether to abort.
append_fct_nodes()
Given node data, append the factor nodes
Provenance$append_fct_nodes(name, role, attrs = NULL)
name
The name of the node.
role
The role for the node.
attrs
The attributes.
append_lvl_nodes()
Given node data, append the level nodes
Provenance$append_lvl_nodes(
value,
n = NULL,
label = NULL,
attrs = NULL,
fid = NULL
)
value
The value of the node.
n
The number of replications.
label
The labels for the levels.
attrs
The attributes.
fid
The factor id.
append_fct_edges()
Given edge data, append the factor edges
Provenance$append_fct_edges(from, to, type = NULL, group = FALSE, attrs = NULL)
from
The node id from.
to
The node id to.
type
The type of edges.
group
A logical value to indicate whether to create new group id or not.
attrs
The attributes.
append_lvl_edges()
Given edge data, append the level edges
Provenance$append_lvl_edges(from, to, attrs = NULL)
from
The node id from.
to
The node id to.
attrs
The attributes.
serve_units()
Serve the units.
Provenance$serve_units(id = NULL, return = c("id", "value"))
id
The id of the corresponding node.
return
To return in "id" or "value" format.
serve_trts()
Serve treatments
Provenance$serve_trts(id = NULL, return = c("id", "value"))
id
The id of the corresponding node.
return
To return in "id" or "value" format.
serve_rcrds()
Serve records
Provenance$serve_rcrds(id = NULL, return = c("id", "value"))
id
The id of the corresponding node.
return
To return in "id" or "value" format.
make_trts_table()
Make the treatments table
Provenance$make_trts_table(id = NULL, return = c("id", "value"))
id
The id of the corresponding node.
return
To return in "id" or "value" format.
A treatment table
graph_subset()
Subset graph
Provenance$graph_subset(
id = NULL,
include = c("self", "child", "parent", "ancestors")
)
id
The 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)
seed
A seed.
type
Type.
get_title()
Get the title
Provenance$get_title()
get_validation()
Get the validation
Provenance$get_validation(type = NULL)
type
A 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)
name
The process name. Only one name allowed.
get_simulate_result_env()
Get the simulation results
Provenance$get_simulate_result_env(name = NULL)
name
The process name. Only one name allowed.
mapping()
Mapping of a role to role
Provenance$mapping(role_from, role_to)
role_from
The role from.
role_to
The role to.
mapping_to_unit()
Mapping of an id to a unit
Provenance$mapping_to_unit(id = NULL)
id
The 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, to
The factor id.
return
To return in "id" or "value" format.
record_track_external()
Record track external.
Provenance$record_track_external(code)
code
The code to record.
fct_id_links()
Find all id that is linked.
Provenance$fct_id_links(id = NULL, role = NULL, link = c("direct", "indirect"))
id
The id of the corresponding node.
role
The role for the node.
link
Whether 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)
id
The 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)
deep
Whether to make a deep clone.
The Provenance contains a set of operations to manipulate the nodes and edges of the edibble graph object.