snahelper

Rstudio Addin for Network Analysis and Visualization

https://github.com/schochastics/snahelper

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (16.6%) to scientific vocabulary

Keywords

network-analysis r rstudio-addin
Last synced: 6 months ago · JSON representation

Repository

Rstudio Addin for Network Analysis and Visualization

Basic Info
Statistics
  • Stars: 88
  • Watchers: 6
  • Forks: 6
  • Open Issues: 0
  • Releases: 4
Topics
network-analysis r rstudio-addin
Created about 7 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Citation

README.Rmd

---
output: github_document
---



```{r setup, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# snahelper 
[![R-CMD-check](https://github.com/schochastics/snahelper/workflows/R-CMD-check/badge.svg)](https://github.com/schochastics/snahelper/actions)
[![CRAN status](https://www.r-pkg.org/badges/version/snahelper)](https://cran.r-project.org/package=snahelper)
[![Downloads](https://cranlogs.r-pkg.org/badges/snahelper)](https://CRAN.R-project.org/package=snahelper)

`snahelper` provides a set RStudio Addin for social network analysis. 
The main addin is the `SNAhelper` which provides a simple GUI to do common network analytic tasks
and visualize a network with [ggraph](https://ggraph.data-imaginist.com/).

The second addin, called `Netbuilder` allows you to quickly build small networks with a small 
"canvas" to draw on. The network can be exported as an igraph object at the end of the session by clicking on "Done".

The third addin `Netreader` is meant to facilitated the import of raw network data. It provides a GUI to easily
read network and attribute data and combine them to an igraph object. The underlying code of the import procedure
is shown at the end. This should help users to learn importing data themselves.  

The fourth addin `Componentlayouter` allows to layout networks with several components manually by placing them on an empty
canvas. Components can also be rotated and resized. After finishing the session, the layout is saved as x and y vertex attributes.

## Quick look at the SNAhelper

![](man/figures/snahelper.gif)

Code to reproduce the used network.
```{r starwars,eval=F}
library(tidyverse)
library(igraph)
url <- "https://raw.githubusercontent.com/evelinag/StarWars-social-network/master/networks/starwars-full-interactions-allCharacters.json"
df <- jsonlite::fromJSON(url)

df$nodes$id <- 1:nrow(df$nodes)
df$nodes$display <- df$nodes$name
df$nodes$name <- df$nodes$id-1
g <- graph_from_data_frame(df$links,directed = F,vertices = df$nodes)

V(g)$name <- V(g)$display

g <- remove.vertex.attribute(g,"id")
g <- remove.vertex.attribute(g,"display")
g <- delete.vertices(g,which(degree(g)==0))

V(g)$display <- ifelse(V(g)$value>75,V(g)$name,"")
V(g)$colour <- ifelse(V(g)$display=="",NA,V(g)$display)

g

```

## Quick look at the Netreader

`Netreader` should be pretty selfexplanatory. The first two tabs allow you to import
raw data (edges and attributes). Make sure to specify file delimiters, etc. according to the shown preview.


![](man/figures/Netreader1.png)

Using the `Netreader` should comes with a learning effect (hopefully). The last tab shows the R code
to produce the network with the chosen data **without** using the Addin. 
![](man/figures/Netreader2.png)

The network will be saved in your global environment once you click "Done".

## Quick look at the Netbuilder

![](man/figures/Netbuilder.gif)

## Quick look at the Componentlayouter

![](man/figures/Componentlayouter.gif)

Highlight an igraph object in your script and selcet the `Componentlayouter` from the RStudio addin menu.
Components are added by clicking on the canvas and can be resized/rotated and re-positioned using the buttons at the 
bottom. The final layout is stored as x and y coordinates in the igraph object.

## Installation

``` {r install1,eval=FALSE}
# developer version
#install.packages(remotes)
remotes::install_github("schochastics/snahelper")

#CRAN version
install.packages("snahelper")
```



To work properly, you also need [graphlayouts](https://github.com/schochastics/graphlayouts), which adds new
layout algorithms.
```{r install2,eval=FALSE}
install.packages("graphlayouts")
```

## Usage of SNAhelper

To use the main addin, simply highlight a network in your script and select 
`SNAhelper` from the Addin dropdown menu.

## Interface

### Layout

The layout tab allows you to choose from all implemented algorithms in `igraph` and
some layouts from `graphlayouts`. The default is a stress based layout and also the recommended choice.
See [my blog](http://blog.schochastics.net/post/stress-based-graph-layouts/) for an
explanation. In the tweak section you can move individual nodes around. Choose the node from
the dropdown menu and click on its new position in the plot.

![](man/figures/layout.png)

### Node Attribute Manager

The Node Attribute Manager shows all existing node attributes in a sortable table.
In addition, you can calculate some new ones (centrality and clustering). 
The functions automatically choose the right version of indices, depending if
the network is directed/weighted/undirected/unweighted.

![](man/figures/NattributeMan.png)

### Nodes

This is where you can style your nodes. You can either do it manually, by choosing a
color/size for all nodes together, or based on an attribute.

![](man/figures/nodes.png)

### Edge Attribute Manager

Same as Node Attribute Manager but for edges. So far only shows existing edge attributes.

![](man/figures/EattributeMan.png)

### Edges

You can style your edges here. `snahelper` automatically detects if your network
is directed and adds arrows if the network is directed. The other options are similar to the nodes tab.
The snahelper automatically chooses the appropriate edge geom. If multiple edges are present, it uses
`geom_edge_parallel0()`. Otherwise `geom_edge_link0()`.

![](man/figures/edges.png)

### Result

The result tab shows the network in its full size. If you are satisfied with the results, hit
the Done button and the R code to produce the plot is automatically inserted in your script.
Or you can directly save the result as a png file.

![](man/figures/result.png)

Owner

  • Name: David Schoch
  • Login: schochastics
  • Kind: user
  • Location: Germany
  • Company: cynkra

Data Scientist/DevOps Engineer at cynkra and #RStats developer

GitHub Events

Total
  • Watch event: 1
  • Push event: 5
  • Pull request event: 5
  • Fork event: 1
Last Year
  • Watch event: 1
  • Push event: 5
  • Pull request event: 5
  • Fork event: 1

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 91
  • Total Committers: 2
  • Avg Commits per committer: 45.5
  • Development Distribution Score (DDS): 0.011
Past Year
  • Commits: 1
  • Committers: 1
  • Avg Commits per committer: 1.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
schochastics d****d@s****t 90
Jon Harmon j****k@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 11
  • Total pull requests: 1
  • Average time to close issues: 6 months
  • Average time to close pull requests: about 8 hours
  • Total issue authors: 4
  • Total pull request authors: 1
  • Average comments per issue: 0.82
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • schochastics (8)
  • Chuan1997 (1)
  • santiagcarcal (1)
  • tedmoorman (1)
Pull Request Authors
  • ArthurMuehl (2)
  • jonthegeek (1)
Top Labels
Issue Labels
enhancement (2) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 270 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 8
  • Total maintainers: 1
cran.r-project.org: snahelper

'RStudio' Addin for Network Analysis and Visualization

  • Versions: 8
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 270 Last month
Rankings
Stargazers count: 4.8%
Forks count: 11.3%
Average: 23.8%
Dependent packages count: 29.8%
Dependent repos count: 35.5%
Downloads: 37.8%
Maintainers (1)
Last synced: 6 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • actions/upload-artifact main composite
  • r-lib/actions/check-r-package v1 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite
  • r-lib/actions/setup-r-dependencies v1 composite
DESCRIPTION cran
  • R >= 3.0.0 depends
  • DT * imports
  • colourpicker * imports
  • formatR * imports
  • ggplot2 * imports
  • ggraph >= 2.0.0 imports
  • graphlayouts >= 0.5.0 imports
  • igraph * imports
  • miniUI * imports
  • rstudioapi * imports
  • shiny * imports
  • ggforce * suggests
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.4.1 composite
  • actions/checkout v3 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite