Learn R Programming

qdap (version 0.2.5)

tot_plot: Visualize Word Length by Turn of Talk

Description

Uses a bar graph to visualize patterns in sentence length and grouping variables by turn of talk.

Usage

tot_plot(dataframe, text.var, grouping.var = NULL,
    facet.vars = NULL, tot = TRUE, transform = FALSE,
    ncol = NULL, ylab = NULL, xlab = NULL, bar.space = 0,
    scale = NULL, space = NULL)

Arguments

dataframe
A dataframe that contains the text variable and optionally the grouping.var and tot variables.
text.var
The text variable (character string).
grouping.var
The grouping variables. Default NULL generates one word list for all text. Also takes a single grouping variable or a list of 1 or more grouping variables.
facet.vars
An optional single vector or list of 1 or 2 to facet by.
tot
The turn of talk variable (character string). May be TRUE (assumes "tot" is the variable name), FALSE (use row numbers), or a character string of the turn of talk column.
ncol
if an integer value is passed to this gantt_wrap uses facet_wrap rather than facet_
transform
logical. If TRUE the repeated facets will be transformed from stacked to side by side.
ylab
Optional y label.
xlab
Optional x label.
bar.space
The amount space between bars (ranging between 1 and 0).
scale
Should scales be fixed ("fixed", the default), free ("free"), or free in one dimension ("free_x", "free_y")
space
If "fixed", the default, all panels have the same size. If "free_y" their height will be proportional to the length of the y scale; if "free_x" their width will be proportional to the length of the x scal

Value

  • Invisibly returns the ggplot2 object.

Examples

Run this code
dataframe <- sentSplit(DATA, "state")
tot_plot(dataframe, "state")
tot_plot(DATA, "state", tot=FALSE)
tot_plot(dataframe, "state", space=.03)
tot_plot(dataframe, "state", "sex")
tot_plot(mraja1, "dialogue", "fam.aff", tot=FALSE)
tot_plot(mraja1, "dialogue", "died", tot=FALSE)
tot_plot(mraja1, "dialogue", c("sex", "fam.aff"), tot=FALSE) +
    scale_fill_hue(l=40)
tot_plot(mraja1, "dialogue", c("sex", "fam.aff"), tot=FALSE)+
    scale_fill_brewer(palette="Spectral")
tot_plot(mraja1, "dialogue", c("sex", "fam.aff"), tot=FALSE)+
    scale_fill_brewer(palette="Set1")

Run the code above in your browser using DataLab