Learn R Programming

Xplortext (version 1.2.1)

plot.TextData: Plot TextData objects

Description

Draws the barcharts of the longest documents, most frequent words and segments from a TextData object.

Usage

# S3 method for TextData
plot(x, ndoc=25, nword=25, nseg=25, sel=NULL, stop.word.tm=FALSE, 
  stop.word.user=NULL, theme=theme_bw(), title=NULL, xtitle=NULL, col.fill="grey",
  col.lines="black", text.size=12, freq=NULL, vline=NULL,...)

Arguments

x

object of TextData class

ndoc

number of documents in the barchart (by default 25)

nword

number of words in the barchart (by default 25)

nseg

number of segments in the barchart (by default 25)

sel

type of barchart (doc, word or seg for documents, words or repeated segments) (by default NULL and all the barchart are draw)

stop.word.tm

the tm stopwords are not considered for the barchart (by default FALSE)

stop.word.user

the user's stopwords are not considered for the barchart (by default NULL)

theme

theme settings (see ggplot2 package; by default theme_bw())

title

title of the graph (by default NULL and the title is automatically assigned)

xtitle

x title of the graph (by default NULL and the x title is automatically assigned)

col.fill

background color for the barChart bars (by default grey)

col.lines

lines color for the barChart bars (by default black)

text.size

text font size (by default 12)

freq

add frequencies to word and document barplots, see details (by default NULL)

vline

if "YES" or TRUE add vertical line to barplot, see details (by default NULL)

further arguments passed to or from other methods...

Details

freq adds frequencies to barplot (by default NULL). If "YES" or TRUE displays the frequencies at the right of the bars at +5 position. Numerical values display the frequencies at the right positions (positive values) or at the left (negative values).

vline adds a vertical line to barplot (by default NULL). If TRUE a vertical line is added at mean level. If "median" a vertical line is added at median level.

See Also

TextData, print.TextData, summary.TextData

Examples

Run this code
# NOT RUN {
# Non aggregate analysis

 data(open.question)
 res.TD<-TextData(open.question, var.text=c(9,10), remov.number=TRUE, Fmin=10, Dmin=10,  
 stop.word.tm=TRUE, context.quali=c("Gender","Age_Group","Education"), context.quanti=c("Age"))
 plot(res.TD)

# Aggregate analysis
 data(open.question)
 res.TD<-TextData(open.question, var.text=c(9,10), var.agg="Gen_Age", remov.number=TRUE, 
 Fmin=10, Dmin=10, stop.word.tm=TRUE, context.quali=c("Gender","Age_Group","Education"), 
 context.quanti=c("Age"), segment=TRUE)
 plot(res.TD)

# }

Run the code above in your browser using DataLab