Description Usage Arguments Details Value Examples

View source: R/calc_spring_area.R

This function adds the graph characteristic A which is the cross sectional area of the edge.

1 | ```
calc_spring_area(g, value, minimum_value, range)
``` |

`g` |
an igraph object. The graph representing the network |

`value` |
a character string. The name of the edge attribute that is used as value from which Area will be calculated |

`minimum_value` |
a numeric value. Indicating the most thinnest edge |

`range` |
a numeric value. This gives the range of A values above the minimum. |

This function is pretty niche but calculates a cross sectional area of an edge. This is useful when you wish to calculate the spring coefficient k using Young's modulus. The function coerces and edge characteristic to be within a certain range of values preventing negative/zero/infinite values.

a igraph object with the new edge attribute "Area" for each edge

1 2 3 4 5 6 7 8 9 10 | ```
library(igraph)
set.seed(234)
g_prep <- generate_peels_network("A") %>%
set.edge.attribute(., name = "edge_characteristic", value = rep(1:16, each = 10))
g <- calc_spring_area(g_prep, value = "edge_characteristic", minimum_value = 10, range = 20)
get.edge.attribute(g, "Area")
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.