Build Status DOI

qdap (Quantitative Discourse Analysis Package) is an R package designed to assist in quantitative discourse analysis. The package stands as a bridge between qualitative transcripts of dialogue and statistical analysis & visualization.


To download the development version of qdap:

Download the zip ball or tar ball, decompress and run R CMD INSTALL on it, or use the devtools package to install the development version (The user may want to install the dev version of reports first):

# install.packages("devtools")

install_github("qdapDictionaries", "trinker")
install_github("qdapRegex", "trinker")
install_github("qdapTools", "trinker")
install_github("qdap", "trinker")

Note: Windows users need Rtools and devtools to install this way.

Note: Mac users might be required to install the appropriate version XTools from the Apple Developer site in order to install the development version. You may need to register as an Apple developer. An older version of XTools may also be required.



You are welcome to:

Note: If you are reporting a bug make sure you have first read the Cleaning Text & Debugging vignette

Help topics

Project Template

A function to generate a project template of folders, scripts and documents.

Import/Export Data

Functions for importing data and exporting output.

  • condense
    Condense Dataframe Columns
  • dir_map
    Map Transcript Files from a Directory to a Script
  • mcsv_r(mcsv_w)
    Read/Write Multiple csv Files at a Time
  • read.transcript
    Read Transcripts Into R


Function to clean and parse text data.


Functions to aid data viewing.

  • htruncdf(ltruncdf, lview, qview, truncdf)
    Dataframe Viewing
  • left_just(right_just)
    Text Justification
  • Search(%bs%, boolean_search)
    Search Columns of a Data Frame
  • strWrap
    Wrap Character Strings to Format Paragraphs


Functions chain together qdap data and functions.

  • qdap_df(Text, Text<-)
    Create qdap Specific Data Structure
  • %&%(%>%)
    qdap Chaining

Generic qdap Methods

Functions to aid in selection of data elements.


Functions to reshape data.

  • adjacency_matrix(adjmat)
    Takes a Matrix and Generates an Adjacency Matrix
  • colSplit
    Separate a Column Pasted by paste2
  • colsplit2df(lcolsplit2df)
    Wrapper for colSplit that Returns Dataframe(s)
  • colcomb2class
    Combine Columns to Class
  • gantt(plot_gantt_base)
    Gantt Durations
  • gantt_rep
    Generate Unit Spans for Repeated Measures
  • key_merge
    Merge Demographic Information with Person/Text Transcript
  • paste2(colpaste2df)
    Paste an Unspecified Number Of Text Columns
  • prop
    Convert Raw Numeric Matrix or Data Frame to Proportions
  • qcombine
    Combine Columns
  • sentSplit(TOT, sentCombine, sent_detect)
    Sentence Splitting
  • speakerSplit
    Break and Stretch if Multiple Persons per Cell
  • trans_context
    Print Context Around Indices

Word Extraction/Comparison

Functions for working with dialogue at the word level.

  • all_words
    Searches Text Column for Words
  • bag_o_words(breaker, unbag, word_split)
    Bag of Words
  • chunker
    Break Text Into Ordered Word Chunks
  • common
    Find Common Words Between Groups
  • exclude(%ex%, exclude.DocumentTermMatrix, exclude.TermDocumentMatrix, exclude.default, exclude.list, exclude.wfm)
    Exclude Elements From a Vector
  • freq_terms
    Find Frequent Terms
  • ngrams
    Generate ngrams
  • strip
    Strip Text
  • synonyms(syn, syn_frame, synonyms_frame)
    Search For Synonyms
  • word_associate
    Find Associated Words
  • word_diff_list
    Differences In Word Use Between Groups
  • word_list
    Raw Word Lists/Frequency Counts

Coding Tools

cm functions are code matrix functions. These functions are used for coding and reshaping transcripts, dataframes, and time spans for further use in analysis and visualization.

tm Package Integration

Functions for working between the tm and qdap packages.

  • as.tdm(apply_as_df, apply_as_tm, as.Corpus, as.Corpus.DocumentTermMatrix, as.Corpus.TermDocumentMatrix, as.Corpus.default, as.Corpus.sent_split, as.Corpus.wfm, as.DocumentTermMatrix, as.TermDocumentMatrix, as.data.frame.Corpus, as.dtm, as.dtm.Corpus, as.dtm.character, as.dtm.default, as.dtm.wfm, as.tdm.Corpus, as.tdm.character, as.tdm.default, as.tdm.wfm)
    tm Package Compatibility Tools: Apply to or Convert to/from Term Document


Functions for word counts and descriptive statistics.

  • dist_tab
    SPSS Style Frequency Tables
  • multiscale
    Nested Standardization
  • object_pronoun_type
    Count Object Pronouns Per Grouping Variable
  • outlier_detect
    Detect Outliers in Text
  • outlier_labeler
    Locate Outliers in Numeric String
  • pos(pos_by, pos_tags)
    Parts of Speech Tagging
  • pronoun_type
    Count Object/Subject Pronouns Per Grouping Variable
  • question_type
    Count of Question Type
  • subject_pronoun_type
    Count Subject Pronouns Per Grouping Variable
  • syllable_sum(combo_syllable_sum, polysyllable_sum, syllable_count)
  • termco(term_match, termco2mat, termco_d)
    Search For and Count Terms
  • termco_c
    Combine Columns from a termco Object
  • wfm(as.wfm, as.wfm.Corpus, as.wfm.DocumentTermMatrix, as.wfm.TermDocumentMatrix, as.wfm.data.frame, as.wfm.default, as.wfm.matrix, as.wfm.wfdf, weight.wfdf, weight.wfm, wfdf, wfm.Corpus, wfm.character, wfm.factor, wfm.wfdf, wfm_combine, wfm_expanded)
    Word Frequency Matrix
  • word_count(char_table, character_count, character_table, wc)
    Word Counts
  • word_stats
    Descriptive Word Statistics


Word measures and scoring.

qdap Tools

Tools to assist in transcript/discourse analysis.


Identify sentence elements/types.

  • end_inc
    Test for Incomplete Sentences
  • end_mark(end_mark_by)
    Sentence End Marks
  • imperative
    Intuitively Remark Sentences as Imperative
  • NAer
    Replace Missing Values (NA)


Plotting functions.

Network Plots

Network Plots for qdap Objects.

Cumulative Plots

Network Plots for qdap Objects.

  • cumulative(cumulative.animated_formality, cumulative.animated_polarity, cumulative.combo_syllable_sum, cumulative.end_mark, cumulative.formality, cumulative.polarity, cumulative.pos, cumulative.pos_by, cumulative.syllable_freq)
    Cumulative Scores


Animate qdap Objects.

Print Functions


Data sets included in qdap and used in examples.




  • Depends: ggplot2, qdapDictionaries, qdapRegex, qdapTools, RColorBrewer
  • Imports: chron, dplyr, gdata, grid, gridExtra, igraph, NLP, openNLP, parallel, plotrix, RCurl, reports, reshape2, scales, stringdist, tm, tools, venneuler, wordcloud, xlsx, XML
  • Suggests: koRpus, knitr, lda, proxy, stringi, SnowballC, testthat
  • Extends:


Tyler W. Rinker


Dason Kurkiewicz


Bryan Goodrich