Title: | User Interface for Collecting and Analysing Social Networks |
---|---|
Description: | A 'Shiny' application for the interactive visualisation and analysis of networks that also provides a web interface for collecting social media data using 'vosonSML'. |
Authors: | Bryan Gertzel [aut, cre],
Robert Ackland [aut] |
Maintainer: | Bryan Gertzel <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.6.1 |
Built: | 2025-02-22 03:09:59 UTC |
Source: | https://github.com/vosonlab/vosondash |
VOSONDash provides functions and an interface in the form of an interactive R Shiny web application for the visualisation and analysis of network data. The app has sections for visualising and manipulating network graphs, performing text analysis, and displaying network metrics. It also has an interface for the collection of social network data using the vosonSML R package.
Bryan Gertzel and Robert Ackland.
Adds degree, in-degree, out-degree, betweenness and closeness measures to graph as vertex attributes.
addAdditionalMeasures(g)
addAdditionalMeasures(g)
g |
igraph |
An igraph graph object.
This function removes vertices that are not in the selected categories values list or sub-categories.
applyCategoricalFilters( g, selected_cat, selected_subcats, cat_prefix = "vosonCA_" )
applyCategoricalFilters( g, selected_cat, selected_subcats, cat_prefix = "vosonCA_" )
g |
igraph |
selected_cat |
Character string. Selected vertex category without prefix. |
selected_subcats |
List. Selected sub-category values to include in graph. |
cat_prefix |
Character string. Category attribute prefix format to match. Default is |
An igraph graph object.
## Not run: # return a graph containing only vertices that have the vertex category # attribute "vosonCA_Stance" value "liberal" g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") g <- applyCategoricalFilters(g, "Stance", c("liberal")) ## End(Not run)
## Not run: # return a graph containing only vertices that have the vertex category # attribute "vosonCA_Stance" value "liberal" g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") g <- applyCategoricalFilters(g, "Stance", c("liberal")) ## End(Not run)
This function removes any graph vertices that are in components that fall outside of the specified component size range.
applyComponentFilter(g, component_type = "strong", component_range)
applyComponentFilter(g, component_type = "strong", component_range)
g |
igraph |
component_type |
Character string. Use strongly or weakly connected components by specifying |
component_range |
Numeric vector. Min and max values or size range of component. |
An igraph graph object.
This function removes isolate vertices, multiple edges between vertices and or vertex edge loops from a graph.
applyGraphFilters(g, isolates = TRUE, multi_edge = TRUE, loops_edge = TRUE)
applyGraphFilters(g, isolates = TRUE, multi_edge = TRUE, loops_edge = TRUE)
g |
igraph |
isolates |
Logical. Include isolate vertices in graph. Default is |
multi_edge |
Logical. Include multiple edges between vertices in graph. Default is |
loops_edge |
Logical. Include vertex edge loops in graph. Default is |
An igraph graph object.
Removing multiple edges or edge loops from a graph will simplify it and remove other edge attributes.
This function removes a list of vertices from the graph object by vertex id value.
applyPruneFilter(g, selected_prune_verts)
applyPruneFilter(g, selected_prune_verts)
g |
igraph |
selected_prune_verts |
List. Selected vertex ids to remove. |
An igraph graph object.
This function creates a text corpus from node or edge text attribute data in an igraph.
corpusFromGraph( g = NULL, txt_attr = NULL, type = "vertex", iconv = FALSE, html_decode = TRUE, rm_url = TRUE, rm_num = TRUE, rm_punct = TRUE, rm_twit_hashtags = FALSE, rm_twit_users = FALSE, sw_kind = "SMART", rm_words = NULL, stem = FALSE )
corpusFromGraph( g = NULL, txt_attr = NULL, type = "vertex", iconv = FALSE, html_decode = TRUE, rm_url = TRUE, rm_num = TRUE, rm_punct = TRUE, rm_twit_hashtags = FALSE, rm_twit_users = FALSE, sw_kind = "SMART", rm_words = NULL, stem = FALSE )
g |
an igraph graph object. |
txt_attr |
Character string. Name of graph text attribute. Default is |
type |
Character string. Graph attribute type. Default is |
iconv |
Logical. Use the |
html_decode |
Logical. HTML decode text. Default is |
rm_url |
Logical. Remove URL's. Default is |
rm_num |
Logical. Remove numbers. Default is |
rm_punct |
Logical. Remove punctuation. Default is |
rm_twit_hashtags |
Logical. Remove twitter hashtags. Default is |
rm_twit_users |
Logical. Remove twitter user names. Default is |
sw_kind |
Character string. Stopword dictionary. Refer |
rm_words |
Character vector. User defined stopwords. Default is |
stem |
Logical. Apply word stemming. Default is |
A tm text corpus object.
Function creates a vector of calculated network metrics for a graph.
getNetworkMetrics(g, component_type = "strong")
getNetworkMetrics(g, component_type = "strong")
g |
igraph graph object. |
component_type |
Character string. Use strongly or weakly connected components by specifying |
Network metrics as named vector.
This function extracts the subreddit name from a reddit thread url.
getRedditUrlSubreddit(url)
getRedditUrlSubreddit(url)
url |
Character string. Reddit thread url. |
Subreddit name as character string.
This function extracts the thread id from a reddit thread url.
getRedditUrlThreadId(url)
getRedditUrlThreadId(url)
url |
Character string. Reddit thread url. |
Reddit thread id as character string.
This function returns a list of graph vertex attribute names that match a category attribute prefix format and their unique values.
getVertexCategories(g, cat_prefix = "vosonCA_")
getVertexCategories(g, cat_prefix = "vosonCA_")
g |
igraph |
cat_prefix |
Character string. Category attribute prefix format to match. Default is |
A named list of vertex category attributes and values.
## Not run: # get a list of voson vertex categories and values g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") vcats <- getVertexCategories(g) # vcats # $Stance # [1] "conservative" "liberal" ## End(Not run)
## Not run: # get a list of voson vertex categories and values g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") vcats <- getVertexCategories(g) # vcats # $Stance # [1] "conservative" "liberal" ## End(Not run)
This function extracts the youtube video id from a youtube video url.
getYoutubeVideoId(url)
getYoutubeVideoId(url)
url |
Character string. Youtube video url. |
Video id as character string.
This function loads a network graph included in the extdata
directory of the
VOSONDash
package by file name.
loadPackageGraph(fname)
loadPackageGraph(fname)
fname |
Character string. Name of demonstration |
An igraph graph object.
## Not run: # load the "Divided They Blog" package included network graph by file name g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") ## End(Not run)
## Not run: # load the "Divided They Blog" package included network graph by file name g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") ## End(Not run)
Function creates a mixing matrix by graph vertex attribute.
mixmat(g, attrib, use_density = TRUE)
mixmat(g, attrib, use_density = TRUE)
g |
igraph graph object. |
attrib |
Character string. Vertex attribute or category. |
use_density |
Logical. Use edge density. Default is |
A mixing matrix.
Mixing matrix original function written by Gary Weissman. See: https://gist.github.com/gweissman/2402741.
## Not run: # create a mixing matrix of the demonstration network based on vertex # categorical attribute for political stance "vosonCA_Stance" g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") mm <- mixmat(g, "vosonCA_Stance", use_density = FALSE) ## End(Not run)
## Not run: # create a mixing matrix of the demonstration network based on vertex # categorical attribute for political stance "vosonCA_Stance" g <- loadPackageGraph("DividedTheyBlog_40Alist_release.graphml") mm <- mixmat(g, "vosonCA_Stance", use_density = FALSE) ## End(Not run)
This function launches the VOSONDash Shiny app in the default web browser.
runVOSONDash(pkgStartupMsgs = FALSE, isLocal = NULL)
runVOSONDash(pkgStartupMsgs = FALSE, isLocal = NULL)
pkgStartupMsgs |
Logical. Display app package loading messages. Default is |
isLocal |
Logical. Manually set app local or server mode flag. |
None
This function creates a wordcloud plot from word frequencies.
wordCloudPlot( word_freqs, seed = NULL, min_freq = 1, max_words = 50, pcolors = NULL, family = NULL, ... )
wordCloudPlot( word_freqs, seed = NULL, min_freq = 1, max_words = 50, pcolors = NULL, family = NULL, ... )
word_freqs |
Table. Table of word frequencies. |
seed |
Numeric. Seed value can be supplied to reproduce a word cloud layout. |
min_freq |
Numeric. Minimum word frequency to include a word in the word cloud. Default is |
max_words |
Numeric. Maximum number of words to render in the word cloud. Default is |
pcolors |
List. Colors to assign categorical variable in the plot or palette to use if |
family |
Character. Set a font family for plot labels. Default is |
... |
Arguments passed on to
|
A wordcloud plot.
This function creates a horizontal barchart of word frequencies.
wordFreqChart( word_freqs, min_freq = 1, top_count = 20, pcolors = NULL, family = NULL )
wordFreqChart( word_freqs, min_freq = 1, top_count = 20, pcolors = NULL, family = NULL )
word_freqs |
Dataframe. Word frequencies. |
min_freq |
Numeric. Minimum frequency for a word to be included in the chart. Default is |
top_count |
Numeric. Top count of words to render in word frequency chart. Default is |
pcolors |
List. Colors to assign categorical variable in the plot. Default is |
family |
Character string. Set a font family for plot labels. Default is |
A barchart plot.
Create a word frequency dataframe from a text corpus.
wordFreqFromCorpus( corp, rm_sparse = 0.99, word_len = c(3, 26), word_freq = c(1, Inf) )
wordFreqFromCorpus( corp, rm_sparse = 0.99, word_len = c(3, 26), word_freq = c(1, Inf) )
corp |
a tm text corpus object. |
rm_sparse |
Logical. Remove proportion of sparse terms. Default is |
word_len |
Numeric vector. Min and max length of words to include. Default is |
word_freq |
Numeric vector. Min and max frequency of words to include. Default is |
A data.table of word frequencies.
This function creates a horizontal barchart measuring and sorting the eight NRC lexicon emotions. Emotions are measured as the proportion of the total value of the eight emotions in the text as a percentage.
wordSentChart(data, pcolors = NULL)
wordSentChart(data, pcolors = NULL)
data |
Dataframe. NRC emotions table. |
pcolors |
List. Colors to assign categorical variable in the plot. Default is |
A barchart plot.
Uses the syuzhet package implementation of Saif Mohammad’s NRC Emotion lexicon.
This function creates an NRC emotion dataframe from a text corpus.
wordSentData(corp, word_len = c(3, 26))
wordSentData(corp, word_len = c(3, 26))
corp |
tm package document |
word_len |
Numeric vector. Min and max length of words to include. Default is |
An NRC sentiment dataframe.
Uses the syuzhet package implementation of Saif Mohammad’s NRC emotion lexicon.
This function creates a vertical barchart of the sum of negative and positive sentiments, and the valence or net sentiment in a text corpus.
wordSentValenceChart(data)
wordSentValenceChart(data)
data |
Dataframe. NRC emotions table. |
A barchart plot.