Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added vignette materials

  • Loading branch information...
commit d0b332b3a5ebd511f73a190bc9558d42b1117698 1 parent ea7db32
@trinker authored
View
1  .gitignore
@@ -133,3 +133,4 @@ pip-log.txt
tools.R
.gitattributes
qdap.Rproj
+.Rprofile
View
1  R/read.transcript.R
@@ -46,6 +46,7 @@
#' @author Bryan Goodrich and Tyler Rinker <tyler.rinker@@gmail.com>.
#' @references \url{https://github.com/trinker/qdap/wiki/Reading-.docx-\%5BMS-Word\%5D-Transcripts-into-R}
#' @keywords transcript
+#' @seealso \code{\link[qdap]{dir_map}}
#' @export
#' @import XML gdata RCurl
#' @examples
View
9 inst/doc/.gitignore
@@ -1 +1,10 @@
refs.bib
+cache
+qdap-concordance.tex
+qdap.Rnw
+qdap.bcf
+qdap.log
+qdap.pdf
+qdap.run.xml
+qdap.synctex.gz
+qdap.tex
View
119 inst/doc/qdap.Rnw
@@ -1,8 +1,28 @@
\documentclass[a4paper]{article}
-
-\usepackage[margin=2cm]{geometry}
-\usepackage[round]{natbib}
+\usepackage[american]{babel}
+\usepackage{csquotes}
+\usepackage{scrextend}
+\usepackage{amsmath}
+\usepackage[sc]{mathpazo}
+\usepackage{geometry}
+\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
+\setcounter{secnumdepth}{2}
+\setcounter{tocdepth}{2}
\usepackage{url}
+\usepackage[unicode=true,pdfusetitle,
+ bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,
+ breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
+ {hyperref}
+
+\usepackage{hyperref}
+\usepackage{here}
+\usepackage{tcolorbox}
+\usepackage{ulem}
+
+
+\usepackage{listings}
+\usepackage{inconsolata}
+
\newcommand{\acronym}[1]{\textsc{#1}}
\newcommand{\class}[1]{\mbox{\textsf{#1}}}
@@ -11,51 +31,114 @@
\newcommand{\proglang}[1]{\textsf{#1}}
\begin{document}
-\SweaveOpts{concordance=TRUE}
-
-\title{Introduction to \pkg{qdap}: Quantitative Discourse Analysis Package}
+\title{Introduction to \pkg{qdap}:\\Quantitative Discourse Analysis Package}
\author{Tyler W. Rinker}
\maketitle
-<<Init,echo=FALSE,results=hide>>=
-library(qdap)
+<<setup, include=FALSE, cache=FALSE>>=
+library(qdap); library(gdata); library(pacman)
@
\section*{Introduction}
-This vignette gives a short introduction to basic workflow and function usage
-for \pkg{qdap}. \pkg{qdap} is an \proglang{R} package designed
+\hspace{.4cm} This vignette gives an introduction to basic workflow and function
+usage for \pkg{qdap}. \pkg{qdap} is an \proglang{R} package designed
to assist in quantitative discourse analysis. The package stands as a bridge
between qualitative transcripts of dialogue and statistical analysis and
visualization.
+\vspace{.5cm}
-The qdap package automates many of the tasks associated with quantitative
+\pkg{qdap} automates many of the tasks associated with quantitative
discourse analysis of transcripts containing discourse including frequency
counts of sentence types, words, sentence, turns of talk, syllable counts and
other assorted analysis tasks. The package provides parsing tools for preparing
transcript data. Many functions enable the user to aggregate data by any number
-of grouping variables providing analysis and seamless integration with other R
-packages that undertake higher level analysis and visualization of text. This
-provides the user with a more efficient and targeted analysis.
+of grouping variables providing analysis and seamless integration with other
+\proglang{R} packages that undertake higher level analysis and visualization of
+text. This provides the user with a more efficient and targeted analysis.
\section*{Work Flow}
-\section*{Reading in Data}
+\begin{enumerate}
+ \item Transcribing and Initial Coding
+ \item Basic qdap Tools
+ \item Reading In Transcripts
+ \item Viewing
+ \item Cleaning and Parsing text
+ \item Formating Text
+ \item Shaping %key_merge sentSplit
+ \item Coding (range and time stamp) %output, coding, input, reshaping all under transcript range and time (ment
+ \item Code Transformations
+ \item Quantifying (counts, indices and scores)% \item Counts \item Text Scores
+ \item Visualizations %ggplot2, base, grid, lattice
+ \item Export Tables, Plots and Data %save after long parse
+ \item Linking to Other Packages %mention reshape2, plyr, lmer/SEM/lavan/stats/base/
+\end{enumerate}
+
+\section*{Transcribing and Coding}
+\section*{Reading in Transcripts}
-<<Readin,keep.source=TRUE>>=
+\subsection*{Read a Single Transcript}
+<<Readin1a, include=TRUE, eval=FALSE>>=
doc1 <- system.file("extdata/trans1.docx", package = "qdap")
dat1 <- read.transcript(doc1)
truncdf(dat1, 40)
+@
+<<Readin1b, echo = FALSE, results ='markup'>>=
+doc1 <- "C:/R/R-2.15.1/library/qdap/extdata/trans1.docx"
+dat1 <- read.transcript(doc1)
+truncdf(dat1, 40)
+@
+
+<<Readin2a, include=TRUE, eval=FALSE>>=
+dat2 <- read.transcript(doc1, col.names = c("person", "dialogue"))
+truncdf(dat2, 40)
+@
+
+<<Readin2b, echo = FALSE, results ='markup' >>=
dat2 <- read.transcript(doc1, col.names = c("person", "dialogue"))
truncdf(dat2, 40)
+@
+<<Readin3a, include=TRUE, eval=FALSE>>=
doc3 <- system.file("extdata/trans4.xlsx", package = "qdap")
dat3 <- read.transcript(doc3)
truncdf(dat3, 40)
@
-\bibliographystyle{jss}
-\bibliography{refs}
+<<Readin3b, echo = FALSE, results ='markup'>>=
+doc3 <- "C:/R/R-2.15.1/library/qdap/extdata/trans4.xlsx"
+dat3 <- read.transcript(doc3)
+truncdf(dat3, 40)
+@
+
+\subsection*{Reading Many Transcripts}
+
+<<Mreadinga, include=TRUE, eval=FALSE>>=
+DIR <- gsub("trans1.docx", "", system.file("extdata/trans1.docx", package = "qdap"))
+dir_map(DIR, col.names = c("per", "text"))
+@
+
+<<setup2, include=FALSE, cache=FALSE>>=
+options(width=62)
+ listing <- function(x, options) {
+ paste("\\begin{lstlisting}[basicstyle=\\ttfamily,breaklines=true]\n",
+ x, "\\end{lstlisting}\n", sep = "")
+ }
+ knit_hooks$set(source=listing, output=listing)
+@
+
+
+<<Mreadingb, echo = FALSE, results ='markup', tidy=TRUE>>=
+DIR <- "C:/R/R-2.15.1/library/qdap/extdata/"
+dir_map(DIR, col.names = c("per", "text"))
+@
+
+
+\section*{Cleaning and Parsing}
+
+\bibliographystyle{abbrvnat}
+\bibliography{refs}
\end{document}
View
BIN  inst/doc/qdap.pdf
Binary file not shown
View
234 inst/doc/qdap.tex
@@ -1,8 +1,83 @@
-\documentclass[a4paper]{article}
+\documentclass[a4paper]{article}\usepackage{graphicx, color}
+%% maxwidth is the original width if it is less than linewidth
+%% otherwise use linewidth (to make sure the graphics do not exceed the margin)
+\makeatletter
+\def\maxwidth{ %
+ \ifdim\Gin@nat@width>\linewidth
+ \linewidth
+ \else
+ \Gin@nat@width
+ \fi
+}
+\makeatother
-\usepackage[margin=2cm]{geometry}
-\usepackage[round]{natbib}
+\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
+\definecolor{fgcolor}{rgb}{0.2, 0.2, 0.2}
+\newcommand{\hlnumber}[1]{\textcolor[rgb]{0,0,0}{#1}}%
+\newcommand{\hlfunctioncall}[1]{\textcolor[rgb]{0.501960784313725,0,0.329411764705882}{\textbf{#1}}}%
+\newcommand{\hlstring}[1]{\textcolor[rgb]{0.6,0.6,1}{#1}}%
+\newcommand{\hlkeyword}[1]{\textcolor[rgb]{0,0,0}{\textbf{#1}}}%
+\newcommand{\hlargument}[1]{\textcolor[rgb]{0.690196078431373,0.250980392156863,0.0196078431372549}{#1}}%
+\newcommand{\hlcomment}[1]{\textcolor[rgb]{0.180392156862745,0.6,0.341176470588235}{#1}}%
+\newcommand{\hlroxygencomment}[1]{\textcolor[rgb]{0.43921568627451,0.47843137254902,0.701960784313725}{#1}}%
+\newcommand{\hlformalargs}[1]{\textcolor[rgb]{0.690196078431373,0.250980392156863,0.0196078431372549}{#1}}%
+\newcommand{\hleqformalargs}[1]{\textcolor[rgb]{0.690196078431373,0.250980392156863,0.0196078431372549}{#1}}%
+\newcommand{\hlassignement}[1]{\textcolor[rgb]{0,0,0}{\textbf{#1}}}%
+\newcommand{\hlpackage}[1]{\textcolor[rgb]{0.588235294117647,0.709803921568627,0.145098039215686}{#1}}%
+\newcommand{\hlslot}[1]{\textit{#1}}%
+\newcommand{\hlsymbol}[1]{\textcolor[rgb]{0,0,0}{#1}}%
+\newcommand{\hlprompt}[1]{\textcolor[rgb]{0.2,0.2,0.2}{#1}}%
+
+\usepackage{framed}
+\makeatletter
+\newenvironment{kframe}{%
+ \def\at@end@of@kframe{}%
+ \ifinner\ifhmode%
+ \def\at@end@of@kframe{\end{minipage}}%
+ \begin{minipage}{\columnwidth}%
+ \fi\fi%
+ \def\FrameCommand##1{\hskip\@totalleftmargin \hskip-\fboxsep
+ \colorbox{shadecolor}{##1}\hskip-\fboxsep
+ % There is no \\@totalrightmargin, so:
+ \hskip-\linewidth \hskip-\@totalleftmargin \hskip\columnwidth}%
+ \MakeFramed {\advance\hsize-\width
+ \@totalleftmargin\z@ \linewidth\hsize
+ \@setminipage}}%
+ {\par\unskip\endMakeFramed%
+ \at@end@of@kframe}
+\makeatother
+
+\definecolor{shadecolor}{rgb}{.97, .97, .97}
+\definecolor{messagecolor}{rgb}{0, 0, 0}
+\definecolor{warningcolor}{rgb}{1, 0, 1}
+\definecolor{errorcolor}{rgb}{1, 0, 0}
+\newenvironment{knitrout}{}{} % an empty environment to be redefined in TeX
+
+\usepackage{alltt}
+\usepackage[american]{babel}
+\usepackage{csquotes}
+\usepackage{scrextend}
+\usepackage{amsmath}
+\usepackage[sc]{mathpazo}
+\usepackage{geometry}
+\geometry{verbose,tmargin=2.5cm,bmargin=2.5cm,lmargin=2.5cm,rmargin=2.5cm}
+\setcounter{secnumdepth}{2}
+\setcounter{tocdepth}{2}
\usepackage{url}
+\usepackage[unicode=true,pdfusetitle,
+ bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=2,
+ breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
+ {hyperref}
+
+\usepackage{hyperref}
+\usepackage{here}
+\usepackage{tcolorbox}
+\usepackage{ulem}
+
+
+\usepackage{listings}
+\usepackage{inconsolata}
+
\newcommand{\acronym}[1]{\textsc{#1}}
\newcommand{\class}[1]{\mbox{\textsf{#1}}}
@@ -10,36 +85,159 @@
\newcommand{\pkg}[1]{{\normalfont\fontseries{b}\selectfont #1}}
\newcommand{\proglang}[1]{\textsf{#1}}
-\usepackage{Sweave}
\begin{document}
-\input{qdap-concordance}
-
-\title{Introduction to \pkg{qdap}: Quantitative Discourse Analysis Package}
+\title{Introduction to \pkg{qdap}:\\Quantitative Discourse Analysis Package}
\author{Tyler W. Rinker}
\maketitle
+
+
\section*{Introduction}
-This vignette gives a short introduction to basic workflow and function usage
-for \pkg{qdap}. \pkg{qdap} is an \proglang{R} package designed
+\hspace{.4cm} This vignette gives an introduction to basic workflow and function
+usage for \pkg{qdap}. \pkg{qdap} is an \proglang{R} package designed
to assist in quantitative discourse analysis. The package stands as a bridge
between qualitative transcripts of dialogue and statistical analysis and
visualization.
+\vspace{.5cm}
-The qdap package automates many of the tasks associated with quantitative
+\pkg{qdap} automates many of the tasks associated with quantitative
discourse analysis of transcripts containing discourse including frequency
counts of sentence types, words, sentence, turns of talk, syllable counts and
other assorted analysis tasks. The package provides parsing tools for preparing
transcript data. Many functions enable the user to aggregate data by any number
-of grouping variables providing analysis and seamless integration with other R
-packages that undertake higher level analysis and visualization of text. This
-provides the user with a more efficient and targeted analysis.
+of grouping variables providing analysis and seamless integration with other
+\proglang{R} packages that undertake higher level analysis and visualization of
+text. This provides the user with a more efficient and targeted analysis.
\section*{Work Flow}
-\section*{Reading in Data}
+\begin{enumerate}
+ \item Transcribing and Initial Coding
+ \item Reading In Transcripts
+ \item Viewing
+ \item Low Level qdap Tools
+ \item Cleaning and Parsing
+ \item Shaping %key_merge sentSplit
+ \item Coding (range and time stamp) %output, coding, input, reshaping all under transcript range and time (ment
+ \item Code Transformations
+ \item Quantifying (counts, indices and scores)% \item Counts \item Text Scores
+ \item Visualizations %ggplot2, base, grid, lattice
+ \item Export Tables, Plots and Data %save after long parse
+ \item Linking to Other Packages %mention reshape2, plyr, lmer/SEM/lavan/stats/base/
+\end{enumerate}
+
+\section*{Transcribing and Coding}
+\section*{Reading in Transcripts}
+
+\subsection*{Read a Single Transcript}
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{alltt}
+doc1 <- \hlfunctioncall{system.file}(\hlstring{"extdata/trans1.docx"}, package = \hlstring{"qdap"})
+dat1 <- \hlfunctioncall{read.transcript}(doc1)
+\hlfunctioncall{truncdf}(dat1, 40)
+\end{alltt}
+\end{kframe}
+\end{knitrout}
+
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{verbatim}
+## X1 X2
+## 1 Researcher 2 October 7, 1892.
+## 2 Teacher 4 Students it's time to learn. [Student di
+## 3 Multiple Students Yes teacher we're ready to learn.
+## 4 [Cross Talk 3 00]
+## 5 Teacher 4 Let's read this terrific book together.
+\end{verbatim}
+\end{kframe}
+\end{knitrout}
+
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{alltt}
+dat2 <- \hlfunctioncall{read.transcript}(doc1, col.names = \hlfunctioncall{c}(\hlstring{"person"}, \hlstring{"dialogue"}))
+\hlfunctioncall{truncdf}(dat2, 40)
+\end{alltt}
+\end{kframe}
+\end{knitrout}
+
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{verbatim}
+## person dialogue
+## 1 Researcher 2 October 7, 1892.
+## 2 Teacher 4 Students it's time to learn. [Student di
+## 3 Multiple Students Yes teacher we're ready to learn.
+## 4 [Cross Talk 3 00]
+## 5 Teacher 4 Let's read this terrific book together.
+\end{verbatim}
+\end{kframe}
+\end{knitrout}
+
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{alltt}
+doc3 <- \hlfunctioncall{system.file}(\hlstring{"extdata/trans4.xlsx"}, package = \hlstring{"qdap"})
+dat3 <- \hlfunctioncall{read.transcript}(doc3)
+\hlfunctioncall{truncdf}(dat3, 40)
+\end{alltt}
+\end{kframe}
+\end{knitrout}
+
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{verbatim}
+## V1 V2
+## 1 Researcher 2: October 7, 1892.
+## 2 Teacher 4: Students it's time to learn.
+## 3 <NA> <NA>
+## 4 Multiple Students: Yes teacher we're ready to learn.
+## 5 <NA> <NA>
+## 6 Teacher 4: Let's read this terrific book together.
+\end{verbatim}
+\end{kframe}
+\end{knitrout}
+
+
+\subsection*{Reading Many Transcripts}
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{alltt}
+DIR <- \hlfunctioncall{gsub}(\hlstring{"trans1.docx"}, \hlstring{""}, \hlfunctioncall{system.file}(\hlstring{"extdata/trans1.docx"}, package = \hlstring{"qdap"}))
+\hlfunctioncall{dir_map}(DIR, col.names = \hlfunctioncall{c}(\hlstring{"per"}, \hlstring{"text"}))
+\end{alltt}
+\end{kframe}
+\end{knitrout}
+
+
+
+
+
+
+\begin{knitrout}
+\definecolor{shadecolor}{rgb}{0.969, 0.969, 0.969}\color{fgcolor}\begin{kframe}
+\begin{lstlisting}[basicstyle=\ttfamily,breaklines=true]
+## dat1 <- read.transcript('C:/R/R-2.15.1/library/qdap/extdata//trans1.docx', col.names = c('per', 'text'), skip = 0)
+## dat2 <- read.transcript('C:/R/R-2.15.1/library/qdap/extdata//trans2.docx', col.names = c('per', 'text'), skip = 0)
+## dat3 <- read.transcript('C:/R/R-2.15.1/library/qdap/extdata//trans3.docx', col.names = c('per', 'text'), skip = 0)
+## dat4 <- read.transcript('C:/R/R-2.15.1/library/qdap/extdata//trans4.xlsx', col.names = c('per', 'text'), skip = 0)
+\end{lstlisting}
+\end{kframe}
+\end{knitrout}
+
+
+
+\section*{Cleaning and Parsing}
+
+\bibliographystyle{abbrvnat}
+\bibliography{refs}
-\begin{Schunk}
-\begin{Sinput}
-> doc1 <- system.file("extdata/trans1.docx", package = "qdap")
-> dat1 <- read.transcript(doc1)
+\end{document}
Please sign in to comment.
Something went wrong with that request. Please try again.