Learn R Programming

cograph (version 2.7.2)

as.data.frame.cograph_motif_result: Motif Results as a Data Frame

Description

Returns the tables held by a motif result from motifs or subgraphs as tidy data frames.

Usage

# S3 method for cograph_motif_result
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  ...,
  what = c("results", "types")
)

Value

A data.frame. For what = "results" in a census, the columns are type and count, plus expected, z, p and sig when significance was tested. For subgraphs(), the columns are triad, node1, node2, node3, type and observed, plus the significance columns when tested. For what = "types", the columns are type and count.

Arguments

x

A cograph_motif_result object.

row.names, optional

Standard as.data.frame arguments; row.names replaces the default row names.

...

Unused.

what

Which table to return. "results" (default) returns the main table: one row per triad type for a census, or one row per node triple and type for subgraphs(). "types" returns one row per triad type with its count: the number of triads of that type in a census, or the number of node triples of that type in subgraphs().

See Also

motifs, subgraphs

Examples

Run this code
census <- motifs(regulation_net, significance = FALSE)
as.data.frame(census)
as.data.frame(census, what = "types")

Run the code above in your browser using DataLab