From cfb146ee9f4c61ba15ab4d5d6ec0f95e37ec07be Mon Sep 17 00:00:00 2001 From: trinker Date: Thu, 31 Jul 2014 22:47:10 -0400 Subject: [PATCH] updated docuemntation after spell check for push to CRAN --- R/Network.R | 6 ++--- R/as.tdm.R | 6 ++--- R/check_spelling.R | 12 ++++----- R/discourse_map.R | 8 +++--- R/dispersion_plot.R | 2 +- R/dissimilarity.R | 2 +- R/end_mark.R | 25 ++++++++++++++----- R/formality.R | 2 +- R/gantt.R | 2 +- R/gantt_plot.R | 2 +- R/igraph_params.R | 2 +- R/multigsub.R | 2 +- R/name2sex.R | 2 +- R/polarity.R | 11 ++++---- R/sentSplit.R | 2 +- man/Dissimilarity.Rd | 2 +- man/Network.formality.Rd | 2 +- man/Network.polarity.Rd | 2 +- man/addNetwork.Rd | 2 +- man/as.tdm.Rd | 6 ++--- man/check_spelling.Rd | 6 ++--- man/check_spelling_interactive.character.Rd | 2 +- ...eck_spelling_interactive.check_spelling.Rd | 2 +- man/check_spelling_interactive.factor.Rd | 2 +- man/dispersion_plot.Rd | 2 +- man/end_mark.Rd | 23 +++++++++++++---- man/gantt.Rd | 2 +- man/gantt_plot.Rd | 2 +- man/igraph_params.Rd | 2 +- man/multigsub.Rd | 2 +- man/name2sex.Rd | 2 +- man/plot.animated_discourse_map.Rd | 4 +-- man/polarity.Rd | 9 ++++--- man/print.Network.Rd | 4 +-- man/print.animated_discourse_map.Rd | 4 +-- man/sentSplit.Rd | 2 +- 36 files changed, 99 insertions(+), 71 deletions(-) diff --git a/R/Network.R b/R/Network.R index 1d2d7754..24956da7 100644 --- a/R/Network.R +++ b/R/Network.R @@ -45,9 +45,9 @@ function(x, ...){ #' @importFrom qdapTools lookup #' @note The output from \code{Network} is an \pkg{igraph} object and can be #' altered and plotted directly using \pkg{igraph}. The \pkg{qdap} \code{print} -#' method is offered as a quick approach to styling the figure. For mor control +#' method is offered as a quick approach to styling the figure. For more control #' use \code{\link[igraph]{V}}, \code{\link[igraph]{E}}, and -#' \code{plot.igrapgh}. +#' \code{plot.igraph}. #' @method print Network #' @export print.Network <- function(x, title = NA, title.color = "black", @@ -118,7 +118,7 @@ plot.Network <- function(x, ...){ #' #' This operator allows you to add themes to a Network object. #' -#' @param Network.obj A object of class \code{Network}. +#' @param Network.obj An object of class \code{Network}. #' @param x A component to add to \code{Network.obj} #' @export #' @rdname addNetwork diff --git a/R/as.tdm.R b/R/as.tdm.R index ce211805..409d4486 100644 --- a/R/as.tdm.R +++ b/R/as.tdm.R @@ -66,7 +66,7 @@ #' speech <- stemmer(dat$dialogue) #' mytable1 <- with(dat, as.tdm(speech, list(person, time), stopwords = Top25Words)) #' -#' fit <- ca(as.matrix(ytable1)) +#' fit <- ca(as.matrix(mytable1)) #' summary(fit) #' plot(fit) #' plot3d.ca(fit, labels=1) @@ -520,9 +520,9 @@ wfm2xtab <- function(text.var, grouping.var = NULL, ...) { #' @param sent.split logical. If \code{TRUE} the text variable sentences will #' be split into individual rows. #' @param row.names \code{NULL} or a character vector giving the row names for -#' the data frame. Not used in \pkg{qdap}; for base genric consistency. +#' the data frame. Not used in \pkg{qdap}; for base generic consistency. #' @param optional logical. If \code{TRUE}, setting row names and converting -#' column names is optional. Not used in \pkg{qdap}; for base genric consistency. +#' column names is optional. Not used in \pkg{qdap}; for base generic consistency. #' @return \code{as.data.frame} - Converts a \code{\link[tm]{Corpus}} and returns #' a \pkg{qdap} oriented \code{\link[base]{data.frame}}. #' @rdname as.tdm diff --git a/R/check_spelling.R b/R/check_spelling.R index 425bf8d8..a0116eb1 100644 --- a/R/check_spelling.R +++ b/R/check_spelling.R @@ -161,10 +161,10 @@ check_spelling <- function(text.var, range = 2, #' @param suggest logical. If \code{TRUE} returns a #' \code{\link[base]{data.frame}} with possible suggestions for misspelled words #' (words not found in the dictionary). -#' @param nchar.dictionary A vector that correponds in length and content to +#' @param nchar.dictionary A vector that corresponds in length and content to #' \code{dictionary} with elements that are the precalculated number of #' characters for each word in the dictionary. -#' @param first.char.dictionary A vector that corresponds in length ans content +#' @param first.char.dictionary A vector that corresponds in length and content #' to \code{dictionary} with elements that are the pre-allotted first characters #' of each word in the dictionary. #' @return \code{which_misspelled} - Returns either a named vector (names are @@ -272,7 +272,7 @@ print.which_misspelled <- function(x, ...){ #' \code{check_spelling_interactive} - Interactively check spelling. #' #' @param click logical. If \code{TRUE} the interface is a point and click GUI. -#' If \code{FALSE} the interace is command line driven. +#' If \code{FALSE} the interface is command line driven. #' @note \code{check_spelling_interactive} - The user may go back (undo) by #' pressing \code{"TYPE MY OWN"} entering either \code{"!"} (not) or \code{"0"} #' (similar to a phone system). The second choice in the @@ -358,7 +358,7 @@ correct <- function(x, ...){ #' first letter of the misspelled word is correct. This reduces the dictionary #' size, thus speeding up computation. #' @param click logical. If \code{TRUE} the interface is a point and click GUI. -#' If \code{FALSE} the interace is command line driven. +#' If \code{FALSE} the interface is command line driven. #' @param method Method for distance calculation. The default is "jaccard". It #' is assumed that smaller measures indicate closer distance. Measures that do #' not adhere to this assumption will result in incorrect output (see @@ -427,7 +427,7 @@ check_spelling_interactive.character <- function(text.var, range = 2, #' first letter of the misspelled word is correct. This reduces the dictionary #' size, thus speeding up computation. #' @param click logical. If \code{TRUE} the interface is a point and click GUI. -#' If \code{FALSE} the interace is command line driven. +#' If \code{FALSE} the interface is command line driven. #' @param method Method for distance calculation. The default is "jaccard". It #' is assumed that smaller measures indicate closer distance. Measures that do #' not adhere to this assumption will result in incorrect output (see @@ -494,7 +494,7 @@ check_spelling_interactive.factor <- function(text.var, range = 2, #' first letter of the misspelled word is correct. This reduces the dictionary #' size, thus speeding up computation. #' @param click logical. If \code{TRUE} the interface is a point and click GUI. -#' If \code{FALSE} the interace is command line driven. +#' If \code{FALSE} the interface is command line driven. #' @param method Method for distance calculation. The default is "jaccard". It #' is assumed that smaller measures indicate closer distance. Measures that do #' not adhere to this assumption will result in incorrect output (see diff --git a/R/discourse_map.R b/R/discourse_map.R index 3742cf80..67c292e7 100644 --- a/R/discourse_map.R +++ b/R/discourse_map.R @@ -323,9 +323,9 @@ plot.discourse_map <- function(x, ...){ } -#' Plots a animated_discourse_map Object +#' Plots an animated_discourse_map Object #' -#' Plots a animated_discourse_map object. +#' Plots an animated_discourse_map object. #' #' @param x The animated_discourse_map object. #' @param \ldots Other arguments passed to \code{print.animated_discourse_map }. @@ -398,9 +398,9 @@ animated_discourse_map <- function(DF, edge.constant, sep = "_", igraph_objs } -#' Prints a animated_discourse_map Object +#' Prints an animated_discourse_map Object #' -#' Prints a animated_discourse_map object. +#' Prints an animated_discourse_map object. #' #' @param x The animated_discourse_map object. #' @param title The title of the plot. diff --git a/R/dispersion_plot.R b/R/dispersion_plot.R index 429bc9b2..226e657c 100644 --- a/R/dispersion_plot.R +++ b/R/dispersion_plot.R @@ -6,7 +6,7 @@ #' @param match.terms A vector of quoted terms or a named list of quoted terms. #' If the latter terms will be combined into a single unified theme named #' according to the list names. Note that terms within the vectors of the list -#' cannot be dulicated. +#' cannot be duplicated. #' @param grouping.var The grouping variables. Default \code{NULL} generates #' one word list for all text. Also takes a single grouping variable or a list #' of 1 or more grouping variables. diff --git a/R/dissimilarity.R b/R/dissimilarity.R index 7d44df0f..f11569f0 100644 --- a/R/dissimilarity.R +++ b/R/dissimilarity.R @@ -40,7 +40,7 @@ #' plot(fit) #' pvrect(fit, alpha=.95) #' -#' ## Mutidimentional Scaling +#' ## Multidimentional Scaling #' ## Based on blog post from Bodong Chen #' ## http://bodongchen.com/blog/?p=301 #' diff --git a/R/end_mark.R b/R/end_mark.R index 86112569..e47cdd6c 100644 --- a/R/end_mark.R +++ b/R/end_mark.R @@ -8,7 +8,7 @@ #' @param missing.end.mark A value to use for sentences with missing endmarks. #' @param missing.text A value to use for sentences with missing (\code{NA}) #' text. -#' @param other.endmarks Other 1-2 character endmarks tos earch for. +#' @param other.endmarks Other 1-2 character endmarks to search for. #' @param grouping.var The grouping variables. Default \code{NULL} generates #' one word list for all text. Also takes a single grouping variable or a list #' of 1 or more grouping variables. @@ -79,9 +79,7 @@ #' sentraj <- lapply(with(rajSPLIT, split(dialogue, act)), function(x) { #' end_mark(x) #' }) -#' -#' -#' +#' #' sentplots2 <- lapply(seq_along(sentraj), function(i) { #' m <- plot(cumulative(sentraj[[i]])) #' if (i != 2) m <- m + ylab("") @@ -90,7 +88,22 @@ #' m + ggtitle(paste("Act", act[i])) #' }) #' -#' do.call(grid.arrange, sentplots2) +#' ## ggplot2 function to extract legend +#' g_legend <- function(a.gplot){ +#' tmp <- ggplot_gtable(ggplot_build(a.gplot)) +#' leg <- which(sapply(tmp[["grobs"]], function(x) x[["name"]]) == "guide-box") +#' legend <- tmp[["grobs"]][[leg]] +#' legend +#' } +#' +#' ## remove legends from plots +#' sentplots3 <- lapply(sentplots2, function(x){ +#' x + theme(legend.position="none") + xlab(NULL) + ylab(NULL) +#' }) +#' +#' sentplots3[[6]] <- g_legend(sentplots2[[1]]) +#' +#' do.call(grid.arrange, sentplots3) #' } end_mark <- function(text.var, missing.end.mark = "_", missing.text = NA, other.endmarks = NULL) { @@ -129,7 +142,7 @@ function(x, ...) { #' Sentence End Marks #' #' -#' \code{end_mark_by} - Grab the sentence end marks for a transcriptby grouping +#' \code{end_mark_by} - Grab the sentence end marks for a transcript by grouping #' variable(s). #' #' @rdname end_mark diff --git a/R/formality.R b/R/formality.R index 3fa22653..ebd28f65 100644 --- a/R/formality.R +++ b/R/formality.R @@ -1253,7 +1253,7 @@ plot.animated_formality <- function(x, ...){ #' @param contextual The color to use for 0\% formality (purely contextual). #' @param formal The color to use for 100\% formality (purely formal). #' @param edge.constant A constant to multiple edge width by. -#' @param title The title to apply to the Networkd image(s). +#' @param title The title to apply to the \code{Network}ed image(s). #' @param digits The number of digits to use in the current turn of talk #' formality. #' @param plus.300.color The bar color to use for grouping variables exceeding diff --git a/R/gantt.R b/R/gantt.R index 9adbf5bc..41fc9a7b 100644 --- a/R/gantt.R +++ b/R/gantt.R @@ -68,7 +68,7 @@ #' Animate(plot(ani_gannt)) #' #' library(animation) -#' loc <- folder(animation_gantt) +#' loc <- reports::folder(animation_gantt) #' #' ## Set up the plotting function #' oopt <- animation::ani.options(interval = 0.1) diff --git a/R/gantt_plot.R b/R/gantt_plot.R index 01591b4a..e92da9c8 100644 --- a/R/gantt_plot.R +++ b/R/gantt_plot.R @@ -79,7 +79,7 @@ #' ani_gantt <- with(mraja1, gantt_plot(dialogue, person)) #' #' library(animation) -#' loc <- folder(animation_gantt) +#' loc <- reports::folder(animation_gantt) #' #' ## Set up the plotting function #' oopt <- animation::ani.options(interval = 0.1) diff --git a/R/igraph_params.R b/R/igraph_params.R index a29bf95f..88932dd7 100644 --- a/R/igraph_params.R +++ b/R/igraph_params.R @@ -1,6 +1,6 @@ #' Apply Parameter to List of Igraph Vertices/Edges #' -#' \code{vertex_apply} - Uniformly apply \pkg{igrph} vertex plotting parameters to a list of \pkg{igraph} objects. +#' \code{vertex_apply} - Uniformly apply \pkg{igraph} vertex plotting parameters to a list of \pkg{igraph} objects. #' #' @param x A list of \pkg{igraph} objects. #' @param \ldots Arguments passed \pkg{igraph}'s \code{\link[igraph]{V}} and \code{\link[igraph]{E}}. diff --git a/R/multigsub.R b/R/multigsub.R index e06a9c3d..7b5993fd 100644 --- a/R/multigsub.R +++ b/R/multigsub.R @@ -108,7 +108,7 @@ mgsub <- multigsub #' \item{unhold}{A function used to revert back to the original values} #' @rdname multigsub #' @note The \code{unhold} function for \code{sub_holder} will only work on keys -#' that have not been disturbed by subsequen alterations. The key follows the +#' that have not been disturbed by subsequent alterations. The key follows the #' pattern of `qdapplaceholder` followed by lower case letter keys followed by #' `qdap`. #' @export diff --git a/R/name2sex.R b/R/name2sex.R index a80473b1..eb3a1786 100644 --- a/R/name2sex.R +++ b/R/name2sex.R @@ -13,7 +13,7 @@ #' @param USE.NAMES logical. If \code{TRUE} names.list is used to name the #' gender vector. #' @param database A database of names (mostly for internal purposes). -#' @param \ldots Other aguments passed to \code{\link[qdap]{check_spelling}}. +#' @param \ldots Other arguments passed to \code{\link[qdap]{check_spelling}}. #' @return Returns a vector of predicted gender (M/F) based on first name. #' @author Dason Kurkiewicz and Tyler Rinker . #' @keywords name gender diff --git a/R/polarity.R b/R/polarity.R index 225cbb2b..ad865070 100644 --- a/R/polarity.R +++ b/R/polarity.R @@ -194,7 +194,7 @@ #' #' saveHTML(FUN(), autoplay = FALSE, loop = TRUE, verbose = FALSE, #' ani.height = 1000, ani.width=650, -#' outdir = loc2, single.opts = +#' outdir = loc, single.opts = #' "'controls': ['first', 'play', 'loop', 'speed'], 'delayMin': 0") #' #' #=====================# @@ -207,6 +207,7 @@ #' library(reports) #' library(igraph) #' library(plotrix) +#' library(gridExtra) #' #' deb2dat <- subset(pres_debates2012, time=="time 2") #' deb2dat[, "person"] <- factor(deb2dat[, "person"]) @@ -311,7 +312,7 @@ #' deb2_line <- plot(cumulative(deb2_bar)) #' #' ## Generate a folder -#' loc2 <- folder(animation_polarity2) +#' loc2b <- folder(animation_polarity2) #' #' ## Set up the plotting function #' oopt <- animation::ani.options(interval = 0.1) @@ -325,7 +326,7 @@ #' #' lapply(theseq, function(i) { #' if (follow) { -#' png(file=sprintf("%s/images/Rplot%s.png", loc2, i), +#' png(file=sprintf("%s/images/Rplot%s.png", loc2b, i), #' width=650, height=725) #' } #' ## Set up the layout @@ -368,7 +369,7 @@ #' #' saveHTML(FUN2(), autoplay = FALSE, loop = TRUE, verbose = FALSE, #' ani.height = 1000, ani.width=650, -#' outdir = loc2, single.opts = +#' outdir = loc2b, single.opts = #' "'controls': ['first', 'play', 'loop', 'speed'], 'delayMin': 0") #' #' FUN2(TRUE) @@ -1630,7 +1631,7 @@ constrain <- function(x) ((1 - (1/(1 + exp(x)))) * 2) - 1 #' @param positive The color to use for positive polarity. #' @param neutral The color to use for neutral polarity. #' @param edge.constant A constant to multiple edge width by. -#' @param title The title to apply to the Networkd image(s). +#' @param title The title to apply to the Networked image(s). #' @param digits The number of digits to use in the current turn of talk #' polarity. #' @param \ldots Other arguments passed to \code{\link[qdap]{discourse_map}}. diff --git a/R/sentSplit.R b/R/sentSplit.R index ae31fe44..3715156e 100644 --- a/R/sentSplit.R +++ b/R/sentSplit.R @@ -37,7 +37,7 @@ #' sentence. #' #' @section Suggestion: It is recommended that the user runs \code{\link[qdap]{check_text}} on the -#' output of \code{sentSplit}'s text coloumn. +#' output of \code{sentSplit}'s text column. #' @rdname sentSplit #' @author Dason Kurkiewicz and Tyler Rinker . #' @seealso diff --git a/man/Dissimilarity.Rd b/man/Dissimilarity.Rd index b9ca0194..cfa0ab7b 100644 --- a/man/Dissimilarity.Rd +++ b/man/Dissimilarity.Rd @@ -53,7 +53,7 @@ fit <- suppressMessages(pvclust(wfm.mod, method.hclust="ward", plot(fit) pvrect(fit, alpha=.95) -## Mutidimentional Scaling +## Multidimentional Scaling ## Based on blog post from Bodong Chen ## http://bodongchen.com/blog/?p=301 diff --git a/man/Network.formality.Rd b/man/Network.formality.Rd index 4f4b5083..88fdf794 100644 --- a/man/Network.formality.Rd +++ b/man/Network.formality.Rd @@ -16,7 +16,7 @@ \item{edge.constant}{A constant to multiple edge width by.} -\item{title}{The title to apply to the Networkd image(s).} +\item{title}{The title to apply to the \code{Network}ed image(s).} \item{digits}{The number of digits to use in the current turn of talk formality.} diff --git a/man/Network.polarity.Rd b/man/Network.polarity.Rd index f1cb6926..298867a2 100644 --- a/man/Network.polarity.Rd +++ b/man/Network.polarity.Rd @@ -17,7 +17,7 @@ \item{edge.constant}{A constant to multiple edge width by.} -\item{title}{The title to apply to the Networkd image(s).} +\item{title}{The title to apply to the Networked image(s).} \item{digits}{The number of digits to use in the current turn of talk polarity.} diff --git a/man/addNetwork.Rd b/man/addNetwork.Rd index 4cb635b0..d14712b9 100644 --- a/man/addNetwork.Rd +++ b/man/addNetwork.Rd @@ -6,7 +6,7 @@ \method{+}{Network}(Network.obj, x) } \arguments{ -\item{Network.obj}{A object of class \code{Network}.} +\item{Network.obj}{An object of class \code{Network}.} \item{x}{A component to add to \code{Network.obj}} } diff --git a/man/as.tdm.Rd b/man/as.tdm.Rd index 24ebcf97..b74c7fdb 100644 --- a/man/as.tdm.Rd +++ b/man/as.tdm.Rd @@ -104,10 +104,10 @@ Other arguments passed to \code{\link[qdap]{sentSplit}}. If be split into individual rows.} \item{row.names}{\code{NULL} or a character vector giving the row names for -the data frame. Not used in \pkg{qdap}; for base genric consistency.} +the data frame. Not used in \pkg{qdap}; for base generic consistency.} \item{optional}{logical. If \code{TRUE}, setting row names and converting -column names is optional. Not used in \pkg{qdap}; for base genric consistency.} +column names is optional. Not used in \pkg{qdap}; for base generic consistency.} \item{demographic.vars}{Additional demographic information about the grouping variables. This is a data.frame, list of equal length vectors, or a single @@ -281,7 +281,7 @@ dat <- dat[dat$person \%in\% qcv(ROMNEY, OBAMA), ] speech <- stemmer(dat$dialogue) mytable1 <- with(dat, as.tdm(speech, list(person, time), stopwords = Top25Words)) -fit <- ca(as.matrix(ytable1)) +fit <- ca(as.matrix(mytable1)) summary(fit) plot(fit) plot3d.ca(fit, labels=1) diff --git a/man/check_spelling.Rd b/man/check_spelling.Rd index ee19aeaa..43fe4b1d 100644 --- a/man/check_spelling.Rd +++ b/man/check_spelling.Rd @@ -62,16 +62,16 @@ An object from \code{check_spelling_interactive}.} \code{\link[base]{data.frame}} with possible suggestions for misspelled words (words not found in the dictionary).} -\item{nchar.dictionary}{A vector that correponds in length and content to +\item{nchar.dictionary}{A vector that corresponds in length and content to \code{dictionary} with elements that are the precalculated number of characters for each word in the dictionary.} -\item{first.char.dictionary}{A vector that corresponds in length ans content +\item{first.char.dictionary}{A vector that corresponds in length and content to \code{dictionary} with elements that are the pre-allotted first characters of each word in the dictionary.} \item{click}{logical. If \code{TRUE} the interface is a point and click GUI. -If \code{FALSE} the interace is command line driven.} +If \code{FALSE} the interface is command line driven.} \item{\ldots}{ignored} } diff --git a/man/check_spelling_interactive.character.Rd b/man/check_spelling_interactive.character.Rd index 5712775e..efc88131 100644 --- a/man/check_spelling_interactive.character.Rd +++ b/man/check_spelling_interactive.character.Rd @@ -23,7 +23,7 @@ first letter of the misspelled word is correct. This reduces the dictionary size, thus speeding up computation.} \item{click}{logical. If \code{TRUE} the interface is a point and click GUI. -If \code{FALSE} the interace is command line driven.} +If \code{FALSE} the interface is command line driven.} \item{method}{Method for distance calculation. The default is "jaccard". It is assumed that smaller measures indicate closer distance. Measures that do diff --git a/man/check_spelling_interactive.check_spelling.Rd b/man/check_spelling_interactive.check_spelling.Rd index 68e6cb88..adec447b 100644 --- a/man/check_spelling_interactive.check_spelling.Rd +++ b/man/check_spelling_interactive.check_spelling.Rd @@ -22,7 +22,7 @@ first letter of the misspelled word is correct. This reduces the dictionary size, thus speeding up computation.} \item{click}{logical. If \code{TRUE} the interface is a point and click GUI. -If \code{FALSE} the interace is command line driven.} +If \code{FALSE} the interface is command line driven.} \item{method}{Method for distance calculation. The default is "jaccard". It is assumed that smaller measures indicate closer distance. Measures that do diff --git a/man/check_spelling_interactive.factor.Rd b/man/check_spelling_interactive.factor.Rd index 48d45e75..c3c0b22b 100644 --- a/man/check_spelling_interactive.factor.Rd +++ b/man/check_spelling_interactive.factor.Rd @@ -25,7 +25,7 @@ first letter of the misspelled word is correct. This reduces the dictionary size, thus speeding up computation.} \item{click}{logical. If \code{TRUE} the interface is a point and click GUI. -If \code{FALSE} the interace is command line driven.} +If \code{FALSE} the interface is command line driven.} \item{method}{Method for distance calculation. The default is "jaccard". It is assumed that smaller measures indicate closer distance. Measures that do diff --git a/man/dispersion_plot.Rd b/man/dispersion_plot.Rd index 0d439e0d..566d1863 100644 --- a/man/dispersion_plot.Rd +++ b/man/dispersion_plot.Rd @@ -16,7 +16,7 @@ dispersion_plot(text.var, match.terms, grouping.var = NULL, rm.vars = NULL, \item{match.terms}{A vector of quoted terms or a named list of quoted terms. If the latter terms will be combined into a single unified theme named according to the list names. Note that terms within the vectors of the list -cannot be dulicated.} +cannot be duplicated.} \item{grouping.var}{The grouping variables. Default \code{NULL} generates one word list for all text. Also takes a single grouping variable or a list diff --git a/man/end_mark.Rd b/man/end_mark.Rd index 310698e6..2d9a6769 100644 --- a/man/end_mark.Rd +++ b/man/end_mark.Rd @@ -18,7 +18,7 @@ end_mark_by(text.var, grouping.var, digits = 3, percent = FALSE, \item{missing.text}{A value to use for sentences with missing (\code{NA}) text.} -\item{other.endmarks}{Other 1-2 character endmarks tos earch for.} +\item{other.endmarks}{Other 1-2 character endmarks to search for.} \item{grouping.var}{The grouping variables. Default \code{NULL} generates one word list for all text. Also takes a single grouping variable or a list @@ -51,7 +51,7 @@ End marks include: \code{end_mark} - Grab the sentence end marks for a transcript. This can be useful to categorize based on sentence type. -\code{end_mark_by} - Grab the sentence end marks for a transcriptby grouping +\code{end_mark_by} - Grab the sentence end marks for a transcript by grouping variable(s). } \examples{ @@ -101,8 +101,6 @@ sentraj <- lapply(with(rajSPLIT, split(dialogue, act)), function(x) { end_mark(x) }) - - sentplots2 <- lapply(seq_along(sentraj), function(i) { m <- plot(cumulative(sentraj[[i]])) if (i != 2) m <- m + ylab("") @@ -111,7 +109,22 @@ sentplots2 <- lapply(seq_along(sentraj), function(i) { m + ggtitle(paste("Act", act[i])) }) -do.call(grid.arrange, sentplots2) +## ggplot2 function to extract legend +g_legend <- function(a.gplot){ + tmp <- ggplot_gtable(ggplot_build(a.gplot)) + leg <- which(sapply(tmp[["grobs"]], function(x) x[["name"]]) == "guide-box") + legend <- tmp[["grobs"]][[leg]] + legend +} + +## remove legends from plots +sentplots3 <- lapply(sentplots2, function(x){ + x + theme(legend.position="none") + xlab(NULL) + ylab(NULL) +}) + +sentplots3[[6]] <- g_legend(sentplots2[[1]]) + +do.call(grid.arrange, sentplots3) } } \keyword{end-mark} diff --git a/man/gantt.Rd b/man/gantt.Rd index c95b0e0a..e6372474 100644 --- a/man/gantt.Rd +++ b/man/gantt.Rd @@ -92,7 +92,7 @@ Animate(ani_gannt) Animate(plot(ani_gannt)) library(animation) -loc <- folder(animation_gantt) +loc <- reports::folder(animation_gantt) ## Set up the plotting function oopt <- animation::ani.options(interval = 0.1) diff --git a/man/gantt_plot.Rd b/man/gantt_plot.Rd index c328965c..d40c9deb 100644 --- a/man/gantt_plot.Rd +++ b/man/gantt_plot.Rd @@ -91,7 +91,7 @@ rajSPLIT <- qdap::rajSPLIT ani_gantt <- with(mraja1, gantt_plot(dialogue, person)) library(animation) -loc <- folder(animation_gantt) +loc <- reports::folder(animation_gantt) ## Set up the plotting function oopt <- animation::ani.options(interval = 0.1) diff --git a/man/igraph_params.Rd b/man/igraph_params.Rd index 227cb523..f8db51ee 100644 --- a/man/igraph_params.Rd +++ b/man/igraph_params.Rd @@ -22,7 +22,7 @@ altered for the first and last (ends) objects in the list.} Returns a list of igraph objects. } \description{ -\code{vertex_apply} - Uniformly apply \pkg{igrph} vertex plotting parameters to a list of \pkg{igraph} objects. +\code{vertex_apply} - Uniformly apply \pkg{igraph} vertex plotting parameters to a list of \pkg{igraph} objects. \code{edge_apply} - Uniformly apply \pkg{igrph} edge plotting parameters to a list of \pkg{igraph} objects. } diff --git a/man/multigsub.Rd b/man/multigsub.Rd index e6ca1c37..2fbfe8dd 100644 --- a/man/multigsub.Rd +++ b/man/multigsub.Rd @@ -62,7 +62,7 @@ holders back to the original values. } \note{ The \code{unhold} function for \code{sub_holder} will only work on keys -that have not been disturbed by subsequen alterations. The key follows the +that have not been disturbed by subsequent alterations. The key follows the pattern of `qdapplaceholder` followed by lower case letter keys followed by `qdap`. } diff --git a/man/name2sex.Rd b/man/name2sex.Rd index 1a48f5d1..fa103c27 100644 --- a/man/name2sex.Rd +++ b/man/name2sex.Rd @@ -23,7 +23,7 @@ gender vector.} \item{database}{A database of names (mostly for internal purposes).} -\item{\ldots}{Other aguments passed to \code{\link[qdap]{check_spelling}}.} +\item{\ldots}{Other arguments passed to \code{\link[qdap]{check_spelling}}.} } \value{ Returns a vector of predicted gender (M/F) based on first name. diff --git a/man/plot.animated_discourse_map.Rd b/man/plot.animated_discourse_map.Rd index 2b977e95..1e2d2c19 100644 --- a/man/plot.animated_discourse_map.Rd +++ b/man/plot.animated_discourse_map.Rd @@ -1,7 +1,7 @@ % Generated by roxygen2 (4.0.1): do not edit by hand \name{plot.animated_discourse_map} \alias{plot.animated_discourse_map} -\title{Plots a animated_discourse_map Object} +\title{Plots an animated_discourse_map Object} \usage{ \method{plot}{animated_discourse_map}(x, ...) } @@ -11,6 +11,6 @@ \item{\ldots}{Other arguments passed to \code{print.animated_discourse_map }.} } \description{ -Plots a animated_discourse_map object. +Plots an animated_discourse_map object. } diff --git a/man/polarity.Rd b/man/polarity.Rd index 77cf2b01..1bd33991 100644 --- a/man/polarity.Rd +++ b/man/polarity.Rd @@ -216,7 +216,7 @@ type <- if(.Platform$OS.type == "windows") shell else system saveHTML(FUN(), autoplay = FALSE, loop = TRUE, verbose = FALSE, ani.height = 1000, ani.width=650, - outdir = loc2, single.opts = + outdir = loc, single.opts = "'controls': ['first', 'play', 'loop', 'speed'], 'delayMin': 0") #=====================# @@ -229,6 +229,7 @@ library(qdap) library(reports) library(igraph) library(plotrix) +library(gridExtra) deb2dat <- subset(pres_debates2012, time=="time 2") deb2dat[, "person"] <- factor(deb2dat[, "person"]) @@ -333,7 +334,7 @@ deb2_bar <- Animate(deb2, as.network=FALSE) deb2_line <- plot(cumulative(deb2_bar)) ## Generate a folder -loc2 <- folder(animation_polarity2) +loc2b <- folder(animation_polarity2) ## Set up the plotting function oopt <- animation::ani.options(interval = 0.1) @@ -347,7 +348,7 @@ FUN2 <- function(follow=FALSE, theseq = seq_along(bgb)) { lapply(theseq, function(i) { if (follow) { - png(file=sprintf("\%s/images/Rplot\%s.png", loc2, i), + png(file=sprintf("\%s/images/Rplot\%s.png", loc2b, i), width=650, height=725) } ## Set up the layout @@ -390,7 +391,7 @@ type <- if(.Platform$OS.type == "windows") shell else system saveHTML(FUN2(), autoplay = FALSE, loop = TRUE, verbose = FALSE, ani.height = 1000, ani.width=650, - outdir = loc2, single.opts = + outdir = loc2b, single.opts = "'controls': ['first', 'play', 'loop', 'speed'], 'delayMin': 0") FUN2(TRUE) diff --git a/man/print.Network.Rd b/man/print.Network.Rd index c7842951..d35995ba 100644 --- a/man/print.Network.Rd +++ b/man/print.Network.Rd @@ -60,8 +60,8 @@ Prints a Network object. \note{ The output from \code{Network} is an \pkg{igraph} object and can be altered and plotted directly using \pkg{igraph}. The \pkg{qdap} \code{print} -method is offered as a quick approach to styling the figure. For mor control +method is offered as a quick approach to styling the figure. For more control use \code{\link[igraph]{V}}, \code{\link[igraph]{E}}, and -\code{plot.igrapgh}. +\code{plot.igraph}. } diff --git a/man/print.animated_discourse_map.Rd b/man/print.animated_discourse_map.Rd index 43984bfd..7f2e7ea3 100644 --- a/man/print.animated_discourse_map.Rd +++ b/man/print.animated_discourse_map.Rd @@ -1,7 +1,7 @@ % Generated by roxygen2 (4.0.1): do not edit by hand \name{print.animated_discourse_map} \alias{print.animated_discourse_map} -\title{Prints a animated_discourse_map Object} +\title{Prints an animated_discourse_map Object} \usage{ \method{print}{animated_discourse_map}(x, title = NULL, seed = sample(1:10000, 1), layout = layout.auto, pause = 0, ...) @@ -20,6 +20,6 @@ \item{\ldots}{Other Arguments passed to \code{\link[igraph]{plot.igraph}}.} } \description{ -Prints a animated_discourse_map object. +Prints an animated_discourse_map object. } diff --git a/man/sentSplit.Rd b/man/sentSplit.Rd index 6bc9c3ea..e6ffb691 100644 --- a/man/sentSplit.Rd +++ b/man/sentSplit.Rd @@ -93,7 +93,7 @@ sentence. \section{Suggestion}{ It is recommended that the user runs \code{\link[qdap]{check_text}} on the -output of \code{sentSplit}'s text coloumn. +output of \code{sentSplit}'s text column. } \examples{ \dontrun{