
Plots graph data using the GGally library and ggnet function while incorporating demographic properties. Use this plot function if you have all demographic data available to plot.
plotGraphs2(
data,
prop = 20,
graphmode = "fruchtermanreingold",
attribute1 = NULL,
attribute2 = NULL,
attribute1.label = "Attribute 1",
attribute2.label = "Attribute 2",
attribute.node.labels = NULL,
attribute.nodesize = 10
)
Data from the prepareGraphs function
Rescaling the graph edge sizes for the plot
Type of graphical projection to use. Default is Fruchterman Reingold. Refer to gplot.layout for the various available options
Mapping to the attribute 1 information, can be list or column in data frame (Required)
Mapping to the attribute 2 information, can be list or column in data frame (Required)
Name of the attribute 1 info (Required)
Name of the attribute 2 info (Required)
Mapping to the node labels, can be list or column in data frame (Required)
Size of the nodes. Default will result in size of 10. Can be replaced with custom mapping in list or column in data frame. (Required)
# NOT RUN {
df <- sampleData1
prepNet <- tabulate_edges(df, iscsvfile = FALSE, silentNodes = 0)
baseNet <- prepareGraphs(prepNet, project_title = "Sample Data 1", weightedGraph = TRUE)
attdata <- attributeData
plotGraphs2(baseNet, prop = 20, graphmode = "fruchtermanreingold",
attribute1 = attdata$gender, attribute2 = attdata$ethnicity,
attribute1.label = "Gender", attribute2.label = "Ethnicity",
attribute.node.labels = attdata$node, attribute.nodesize = 12)
# }
Run the code above in your browser using DataLab