View source: R/01_flowgraph_modifiers.R
fg_add_feature | R Documentation |
Adds a feature created using feat_fun
from fg
OR
m
into a given flowGraph object. Only use this function if
you cannot generate the desired features using the existing flowGraph
functions starting with fg_feat_<feature name>
.
fg_add_feature(
fg,
type = "node",
feature,
m = NULL,
feat_fun = NULL,
overwrite = FALSE,
...
)
fg |
flowGraph object. |
type |
A string specifying the type of the feature being added i.e. 'node' or 'edge'. |
feature |
A string indicating the unique name of the feature added. |
m |
A numeric matrix with feature values; it should contain the
same sample id's on row names as in |
feat_fun |
A function that ouputs a feature matrix as in |
overwrite |
A logical variable indicating whether or not the function
should replace the existing feature with the same name if
one is already in |
... |
Other parameters that would be used as input into |
fg_add_feature
adds the given new feature matrix to the
given flowGraph object fg
updating slots
feat
and feat_desc
.
See flowGraph-class
slot feat
and feat_desc
for what should be in these slots.
We do not recommend users to directly use this method unless there is
a clear understanding on how the row and column names should be specified.
Instead, we recommend users to use the functions listed in the "See also"
sections prefixed with "fg_feat_".
flowGraph object.
flowGraph-class
fg_feat_node_prop
fg_feat_node_specenr
fg_get_feature
fg_rm_feature
fg_get_feature_desc
no_cores <- 1
data(fg_data_pos30)
fg <- flowGraph(fg_data_pos30$count, class=fg_data_pos30$meta$class,
prop=FALSE, specenr=FALSE,
no_cores=no_cores)
fg_get_feature_desc(fg)
fg <- fg_add_feature(fg, type="node", feature="count_copy",
m=fg_data_pos30$count)
fg_get_feature_desc(fg)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.