Learn R Programming

qdap (version 2.3.0)

qtheme: Add themes to a Network object.

Description

qtheme - This function builds generic themes to add a theme to a Network object rather than individual print arguments.

theme_nightheat A night heat theme.

theme_badkitchen A 70s kitchen theme.

theme_cafe A cafe theme.

theme_grayscale A grayscale theme.

theme_norah A Norah theme.

theme_hipster A hipster theme.

theme_duskheat A duskheat theme.

Usage

qtheme(x = "generic", title, title.color, layout, legend, legend.cex,
  legend.text.color, legend.gradient, bg, vertex.color, vertex.size,
  vertex.frame.color, vertex.label.color, vertex.label.cex, edge.label.color,
  edge.label.cex)

theme_nightheat(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_badkitchen(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_cafe(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_grayscale(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_greyscale(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_norah(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_hipster(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

theme_duskheat(x = pars[["x"]], title = pars[["title"]], title.color = pars[["title.color"]], layout = pars[["layout"]], legend = pars[["legend"]], legend.cex = pars[["legend.cex"]], legend.gradient = pars[["legend.gradient"]], bg = pars[["bg"]], legend.text.color = pars[["legend.text.color"]], vertex.color = pars[["vertex.color"]], vertex.size = pars[["vertex.size"]], vertex.frame.color = pars[["vertex.frame.color"]], vertex.label.color = pars[["vertex.label.color"]], vertex.label.cex = pars[["vertex.label.cex"]], edge.label.color = pars[["edge.label.color"]], edge.label.cex = pars[["edge.label.cex"]], ...)

Arguments

x

The name of the qtheme.

title

The title of the plot. NULL eliminates title. NA uses title attribute of the Network object.

title.color

The color of the title.

layout

igraph layout to use.

legend

The coordinates of the legend. See color.legend for more information.

legend.cex

character expansion factor. NULL and NA are equivalent to 1.0. See mtext for more information.

legend.text.color

The text legend text color.

legend.gradient

A vector of ordered colors to use for the gradient fills in the network edges.

bg

The color to be used for the background of the device region. See par for more information.

vertex.color

The font family to be used for vertex labels.

vertex.size

The size of the vertex.

vertex.frame.color

The color of the vertex border.

vertex.label.color

The color of the labels.

vertex.label.cex

The font size for vertex labels.

edge.label.color

The color for the edge labels. Use NA to remove.

edge.label.cex

The font size of the edge labels.

Additional arguments supplied to qtheme.

Examples

Run this code
# NOT RUN {
(poldat <- with(sentSplit(DATA, 4), polarity(state, person)))
m <- Network(poldat)
m

m + theme_nightheat
m + theme_cafe
m + theme_grayscale
m + theme_norah
m + theme_hipster
m + theme_badkitchen
m + theme_duskheat

## make your own themes
theme_irish <- qtheme(x = "irish", bg = "grey25", 
    vertex.label.color = "grey50", legend.text.color = "white",
    legend.gradient = c("darkgreen", "white", "darkorange"), 
    edge.label.color="white", vertex.size= 20)

m + theme_irish
# }

Run the code above in your browser using DataLab