Skip to content

Commit

Permalink
v0.3.2 final prep for CRAN release
Browse files Browse the repository at this point in the history
  • Loading branch information
homerhanumat committed Jun 14, 2020
1 parent 96c2069 commit 0d985f9
Show file tree
Hide file tree
Showing 80 changed files with 228 additions and 196 deletions.
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ New instructional helpers:
* `random_normal_factory()`


## Bugfixes
## Bug fixes

Console output for `ttestGC()` and similar functions now shows correctly in
R Markdown notebooks.
Expand Down Expand Up @@ -46,7 +46,7 @@ Addition of vignette "Teaching with Tigerstats."
## Major changes

* Addition of `qnormGC()`
* Addition of check argument to `lmGC()`. Diagnostics are no longer done with the diag argument; instead one calls the `plot()` function.
* Addition of check argument to `lmGC()`. Diagnostics are no longer done with the `diag` argument; instead one calls the `plot()` function.
* Addition of `polyfitGC()`
* Addition of `henderson` data frame; the `seals` data frame has been re-named to `sealsO2` to avoid name conflict with `seals` in the ggplot2 package.
* Addition of function `helpGC()`, a convenience function to view package vignettes in the R Studio Viewer pane.
Expand Down
5 changes: 3 additions & 2 deletions R/BinomSkew.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#' @title Skewness in the Binomial Family of Distributions

#' @description An app to investigate how skewness in a binomial distribtution vanishes
#' when np is large enough. Sample size is set at n = 50, but the user can vary p with a slider.
#' @description An app to investigate how skew-ness in a binomial distribution vanishes
#' when np is large enough. Sample size is set at n = 50, but the user can vary p with a
#' slider.
#'
#' @rdname BinomSkew
#' @usage BinomSkew()
Expand Down
2 changes: 1 addition & 1 deletion R/CIProp.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' @return Graphical and numerical output
#' @export
#' @author Rebekah Robinson \email{rebekah_robinson@@georgetowncollege.edu}
#' @note Uses manipulate from RStudio
#' @note Uses manipulate from R Studio
#' @examples
#' \dontrun{
#' if (require(manipulate)) CIProp()
Expand Down
10 changes: 5 additions & 5 deletions R/ChisqSimSlow.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
#' fixed effects (see below for explanation), x should be the
#' variable that is considered the predictor variable.
#' @param data A data frame from which x and y are drawn.
#' @param effects When effects="fixed", the resampling is performed under
#' the conditon that the row sums in the resampled two-way table (with x
#' for rows) are the same as the row sums in the twoway table based on the
#' @param effects When effects="fixed", the re-sampling is performed under
#' the condition that the row sums in the re-sampled two-way table (with x
#' for rows) are the same as the row sums in the two-way table based on the
#' original data. When effects="random", then both row and column sums
#' in the resampled table may vary: only the sum of the counts is
#' constant. (Note: in the resampling procedure for chisq.test
#' in the re-sampled table may vary: only the sum of the counts is
#' constant. (Note: in the re-sampling procedure for chisq.test
#' in the stats package of R, both row and column sums are
#' required to equal the corresponding sums for the original data.)
#' @return Graphical and numerical output
Expand Down
7 changes: 4 additions & 3 deletions R/DtrellHist.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#' @title Dynamic Trellising (Histogram)

#' @description A manipulative app that facilitates exploration of the distribution of a single numerical
#' variable, conditoned upon the values of either a numerical variable or a factor.
#' @description A manipulative app that facilitates exploration of the distribution
#' of a single numerical variable, conditioned upon the values of either a
#' numerical variable or a factor.
#'
#' @rdname DtrellHist
#' @usage DtrellHist(form,data)
#' @param form a formula of the form \code{~var|cond}. \code{var} must be numeric; \code{cond} may be either numeric or factor.
#' @param data A data frame fromm \code{var} and \code{cond} are drawn.
#' @param data A data frame from \code{var} and \code{cond} are drawn.
#' @return Graphical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
Expand Down
4 changes: 2 additions & 2 deletions R/DtrellScat.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' @title Dynamic Trellising (Scatterplot)

#' @description An app to facilitate exploration of the relationship between two numerical variables, conditonal upon
#' the values of a third variable.
#' @description An app to facilitate exploration of the relationship between two numerical
#' variables, conditional upon the values of a third variable.
#'
#' @rdname DtrellScat
#' @usage DtrellScat(form,data)
Expand Down
2 changes: 1 addition & 1 deletion R/EmpRuleGC.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @return Returns no value. Used for the plotting side-effects.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Uses \code{manipulate} in RStudio
#' @note Uses \code{manipulate} in R Studio
#' @examples
#' \dontrun{
#' if(require(manipulate)) EmpRuleGC(mean=70,sd=3,xlab="Height (inches)")
Expand Down
17 changes: 11 additions & 6 deletions R/FindRegLine.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@
#' @title Find the Regression Line

#' @description The regression minimizes the residual sum of squares (RSS). In this game, the player chooses slope and y-intercept
#' of a line so as to approximate the regression line. The moveable line is set initially as a horizontal line with height equal to
#' the mean of the y-coordinates of the scatterplot, so initially the residual sum of squares equals the total sum of squares (TSS).
#' The player's score is the sum of the number of turns taken and the difference between the current RSS
#' and the regression line's RSS (as a percentage of TSS-RSS for regression line). The aim is to lower one's score.
#' @description The regression minimizes the residual sum of squares (RSS). In this
#' game, the player chooses slope and y-intercept
#' of a line so as to approximate the regression line. The move-able
#' line is set initially as a horizontal line with height equal to
#' the mean of the y-coordinates of the scatter plot, so initially
#' the residual sum of squares equals the total sum of squares (TSS).
#' The player's score is the sum of the number of turns taken and the
#' difference between the current RSS
#' and the regression line's RSS (as a percentage of TSS-RSS for regression
#' line). The aim is to lower one's score.
#'
#' @rdname FindRegLine
#' @usage FindRegLine
#' @return Graphical and numerical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Requires package \code{manipulate}, available only in RStudio.
#' @note Requires package \code{manipulate}, available only in R Studio.
#' @examples
#' \dontrun{
#' if (require(manipulate)) FindRegLine()
Expand Down
2 changes: 1 addition & 1 deletion R/Points2Watch.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#' @return Graphical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Requires package \code{manipulate}, available only in RStudio.
#' @note Requires package \code{manipulate}, available only in R Studio.
#' Uses \code{mvrnorm} from package \code{MASS}.
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/SampDist2Means.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @return Graphical and numerical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Uses \code{manipulate} in RStudio. Also requires package \code{lattice}.
#' @note Uses \code{manipulate} in R Studio. Also requires package \code{lattice}.
#' @examples
#' \dontrun{
#' data(imagpop)
Expand Down
2 changes: 1 addition & 1 deletion R/SampDistMean.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @return Graphical and numerical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Uses \code{manipulate} in RStudio.
#' @note Uses \code{manipulate} in R Studio.
#' @examples
#' \dontrun{
#' data(imagpop)
Expand Down
19 changes: 12 additions & 7 deletions R/ShallowReg.R
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
#' @title Regression Line Too Shallow?

#' @description The regession line is not as steep as the SD Line (line through point of averages, with slope = sd(y)/sd(x)). The difference
#' is especially noticeable when the scatterplot is the result of a sample from a bivariate normal distribution. This app explains
#' why we use the regression line to predict y from x, even though the SD line appears to be a better linear summary of the
#' scatterplot. Can be used as a starting-point for a discussion of "regression to the mean."
#' @description The regression line is not as steep as the SD Line (line
#' through point of averages, with slope = sd(y)/sd(x)). The difference
#' is especially noticeable when the scatter plot is the result of a sample
#' from a bivariate normal distribution. This app explains
#' why we use the regression line to predict y from x, even though the
#' SD line appears to be a better linear summary of the
#' scatter plot. Can be used as a starting-point for a discussion of
#' "regression to the mean."
#'
#' @rdname ShallowReg
#' @usage ShallowReg(n=900,rho=0.5)
#' @param n Number of points in the scatterplot.
#' @param rho Target correlation for the scatterplot. Points are selected from a standardized bivariate normal distribtuion, with
#' @param n Number of points in the scatter plot.
#' @param rho Target correlation for the scatter plot. Points are selected from
#' a standardized bivariate normal distribution, with
#' correlation rho.
#' @return Graphical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Uses \code{manipulate}, available only in RStudio, and \code{mvrnorm} from package \code{MASS}.
#' @note Uses \code{manipulate}, available only in R Studio, and \code{mvrnorm} from package \code{MASS}.
#' @examples
#' \dontrun{
#' if (require(manipulate)) ShallowReg()
Expand Down
2 changes: 1 addition & 1 deletion R/Skewer.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' @title SkewR
#' @title Skewness and Box Plots

#' @description An app to illustrate the effect of skewness on the shape of a boxplot.
#'
Expand Down
2 changes: 1 addition & 1 deletion R/Type12Errors.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#' @description An app to explore the concepts of Type I and Type II errors, and the concept of
#' power. We take samples from a population that is imagined to be normal, and perform the t-procedures
#' for one mean. The Null Hypotheis is H0: mu=170. A slider allows us to vary the true mean mu.
#' for one mean. The Null Hypothesis is H0: mu=170. A slider allows us to vary the true mean mu.
#'
#' @rdname Type12Errors
#' @usage Type12Errors()
Expand Down
2 changes: 1 addition & 1 deletion R/VaryCorrelation.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @return Graphical output.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @note Uses \code{manipulate} in RStudio, and \code{mvrnorm} from package \code{MASS}.
#' @note Uses \code{manipulate} in R Studio, and \code{mvrnorm} from package \code{MASS}.
#' @examples
#' \dontrun{
#' if(require(manipulate)) VaryCorrelation(n=500)
Expand Down
30 changes: 15 additions & 15 deletions R/barchartGC.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#' @title Easy Barcharts
#' @title Easy Bar Charts

#' @description Wrapper for \code{\link{barchart}} in package \code{lattice}. Creates a
#' barchart from raw data using formula-data syntax similar to that of \code{\link{xtabs}},
#' bar chart from raw data using formula-data syntax similar to that of \code{\link{xtabs}},
#' or from a table. Defaults to a "standard"
#' barchart in which the bars are vertical and unstacked. Supports percentage barcharts.
#' bar chart in which the bars are vertical and un-stacked. Supports percentage bar charts.
#'
#' @rdname barchartGC
#' @usage barchartGC(x,data=parent.frame(),type="frequency",flat=FALSE,auto.key=TRUE,
Expand All @@ -13,33 +13,33 @@
#' @param data Usually a data frame that supplies the variables in \code{x}. Variables not in the data
#' argument are searched for in the parent environment.
#' @param type Possible values are "frequency" and "percent".
#' @param flat If set to TRUE, will produce barchart that resembles the layout of \code{xtabs}
#' @param flat If set to TRUE, will produce bar chart that resembles the layout of \code{xtabs}
#' @param auto.key Provides a simple key
#' @param horizontal Determines orientation of the bars (overrriden by flat)
#' @param stack Determines whether bars for tallies are stacked on eac other or placed
#' next to one another (overrriden by flat)
#' @param horizontal Determines orientation of the bars (overridden by flat)
#' @param stack Determines whether bars for tallies are stacked on each other or placed
#' next to one another (overriden by flat)
#' @param ... other arguments passed to \code{barchart}: these include main, sub, and
#' xlab, which are likely to be familiar to students from other \code{lattice} graphical
#' functions. An error is possible if other arguments
#' pertaining to legends are passed (hopefully anyone interested in such will have moved on
#' to \code{barchart}).
#' @return A trellis object describing the barchart.
#' @return A trellis object describing the bar chart.
#' @export
#' @author Homer White \email{hwhite0@@georgetowncollege.edu}
#' @examples
#' #barchart of counts for one factor variable:
#' #bar chart of counts for one factor variable:
#' barchartGC(~sex,data=m111survey)
#'
#' #barchart with percentages and title:
#' #bar chart with percentages and title:
#' barchartGC(~sex,data=m111survey,
#' type="percent",
#' main="Distribution of Sex")
#'
#' #barchart of counts, to study the relationship between
#' #bar chart of counts, to study the relationship between
#' #two factor variables:
#' barchartGC(~sex+seat,data=m111survey)
#'
#' #percentage barchart, two factor variables:
#' #percentage bar chart, two factor variables:
#' barchartGC(~sex+seat,data=m111survey,type="percent")
#'
#' #From tabulated data:
Expand All @@ -50,10 +50,10 @@
#' dieTosses <- c(one=8,two=18,three=11,four=7,five=9,six=7)
#' barchartGC(dieTosses,main="60 Rolls of a Die")
#'
#' # a "flat" barchart, pictorial version of xtabs()
#' # a "flat" bar chart, pictorial version of xtabs()
#' barchartGC(~sex+seat,data=m111survey,flat=TRUE,ylab="Sex")
#'
#' # a "flat" barchart, pictorial version of xtabs()
#' # a "flat" bar chart, pictorial version of xtabs()
#' barchartGC(~sex+seat,data=m111survey,type="percent",flat=TRUE,ylab="Sex")
barchartGC <-
function(x,data=parent.frame(),
Expand All @@ -77,7 +77,7 @@ barchartGC <-
type <- "percent"
}

# handle arugments when user wants a barchart that looks like xtabs()
# handle arugments when user wants a bar chart that looks like xtabs()
if (flat==TRUE) {
stack <- TRUE
horizontal <- TRUE
Expand Down
4 changes: 2 additions & 2 deletions R/chisqtestGC.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
#' simulate.p.value = FALSE, B = 2000, verbose = TRUE)
#' @param x Could be a formula. If so, either ~var (for goodness of fit) or ~var1+var2 (for test for association).
#' Otherwise either a table, matrix or vector of summary data.
#' @param data dataframe supplying variables for formula x. If variables in x ar enot found in the data,
#' @param data dataframe supplying variables for formula x. If variables in x are not found in the data,
#' then they will be searched for in the parent environment.
#' @param p For goodness of fit, a vector of probabilities. This will be automatically scaled so as to sum
#' to 1. Negative elements result in an error message.
#' @param graph produce relevant graph for P-value (chi-square curve or histogram of simulation results).
#' @param simulate.p.value If FALSE, use a chi-square distribution to estimate the P-value. Other possible
#' values are "random" and "fixed" and TRUE. Random effects are suitable for resampling when the data are a random
#' sample from a poulation. Fixed effects assume that the values of the explanatory variable (row variable for table,
#' sample from a population. Fixed effects assume that the values of the explanatory variable (row variable for table,
#' var1 in formula ~var1+var2) remain fixed in resampling, and values of response variable are random with null
#' distribution estimated from the data. When set to TRUE, we implement an equivalent to R's routine.
#' In our view procedure is
Expand Down
2 changes: 1 addition & 1 deletion R/colPerc.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#' @title Column Percents

#' @description Computes column percentages for a given twoway table.
#' @description Computes column percentages for a given two-way table.
#'
#' @rdname colPerc
#' @usage colPerc(tab)
Expand Down
Loading

0 comments on commit 0d985f9

Please sign in to comment.