Description Usage Arguments Examples

Plot undirected graphs constructed from 2D data

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |

`data` |
The data to be displayed in this layer. |

`matrix_g` |
Matrix of edges in calculated graph. Could be a full matrix or sparse from the Matrix package. |

`x` |
Name of the first coordinate. |

`y` |
Name of the second coordinate. |

`label` |
Name of the column coresponding to ground truth in clustering. Could be omitted. |

`colormap` |
Colormap to color the vertices/edges of a graph. |

`color` |
A string indicating of what to color, using a colormap. Four options available: "none", "edge", "degree" and "wdegree". Degree uses colormap to color points based on the number of edges going to/from the given vertex. Wdegree calculates the sum of weights of edges in each vertex. |

`plot_points` |
boolean. Should we plot the vertices? |

`color_points` |
The chosen color for coloring points. |

`color_lines` |
The chosen color for coloring edges. |

`cex_p` |
Change the size of points. |

`size` |
Change the width of edges. |

`matlab` |
boolean. Should we use default MATLAB colors and try to replicate the ggplot theme? |

1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ```
## Edge coloring
data(spiraly)
data(Wfull)
ggraph_jk(spiraly,Wfull)
ggraph_jk(spiraly,Wfull,colormap = colormap::colormap(colormap = "hot", n = 256),cex_p = 1.5)
## exporting graph and changing it
g <- ggraph_jk(data = spiraly, matrix_g = Wfull, color = "degree",cex_p = 3)
g + theme(legend.position = c(0.9,0.2),legend.background=element_blank())
##coloring nodes based on the sum of all weights of edges connected to them.
g <- ggraph_jk(data = spiraly, matrix_g = Wfull, color = "wdegree",cex_p = 3,matlab = T,color_lines = "black")
g + theme(legend.position = c(0.9,0.2),legend.background=element_blank())
``` |

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.