fg_feat_node_specenr: Generates the SpecEnr node feature.

View source: R/02_flowgraph_features.R

fg_feat_node_specenrR Documentation

Generates the SpecEnr node feature.

Description

Generates the SpecEnr node feature and returns it inside the returned flowGraph object.

Usage

fg_feat_node_specenr(fg, no_cores = 1, feature = "prop", overwrite = FALSE)

Arguments

fg

flowGraph object

no_cores

An integer indicating how many cores to parallelize on.

feature

A string indicating feature name; this is the feature SpecEnr will be calculated on.

overwrite

A logical variable indicating whether to overwrite the existing SpecEnr node feature if it exists.

Details

Given a flowGraph object, fg_feat_node_specenr returns the same flowGraph object with an additional SpecEnr and expect_prop node feature and its meta data. The expected proportions feature is made using the prop node and edge features; therefore, the returned flowGraph will also contain these two features. For details on how these feature is calculated.

Value

flowGraph object containing the SpecEnr node feature.

References

\insertRef

yue2019identifyingflowGraph

See Also

flowGraph-class fg_feat_node_prop fg_add_feature fg_get_feature fg_rm_feature fg_get_feature_desc

Examples


 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)

 # SpecEnr is by default calculated based on proportions
 fg <- fg_feat_node_specenr(fg, no_cores=no_cores)

 # SpecEnr can be calculated for other feature values too
 fg <- fg_feat_node_specenr(fg, feature="count")

 show(fg)


aya49/flowGraph documentation built on Feb. 4, 2024, 6:40 p.m.