Skip to content

Commit

Permalink
doc tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesdunham committed Oct 29, 2017
2 parents 367ade3 + a07effe commit 25dd83f
Show file tree
Hide file tree
Showing 37 changed files with 198 additions and 229 deletions.
4 changes: 2 additions & 2 deletions R/class-dgirt_fit.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Class \code{dgirt_fit}: a class for fitted models
#' A class for fitted dynamic group IRT models
#'
#' \code{\link{dgirt}} returns a fitted model object of class \code{dgirt_fit},
#' which inherits from \code{\link{dgo_fit}}.
Expand Down Expand Up @@ -29,7 +29,7 @@
#' head(as.data.frame(toy_dgirtfit, pars = 'theta_bar'))
dgirt_fit <- setClass("dgirt_fit", contains = c("dgo_fit"))

#' Class \code{dgirtfit}: a class for fitted models
#' A class for fitted dynamic group IRT models
#'
#' dgo 0.2.8 deprecated the \code{dgirtfit} class and replaced it with the
#' \code{\link{dgirt_fit}} class.
Expand Down
6 changes: 3 additions & 3 deletions R/class-dgirtin.r
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#' Class \code{dgirtIn}: data prepared for modeling with \code{dgirt}
#' A class for data ready to model
#'
#' \code{shape} generates objects of class \code{dgirtIn} for modeling with
#' \code{dgirt} and \code{dgmrp}.
#' \code{shape()} generates objects of class \code{dgirtIn} for modeling with
#' \code{dgirt()} and \code{dgmrp()}.
#'
#' @aliases dgirtin-class, get_item_n, get_item_names, get_n, dgirtIn-method,
#' print.dgirtIn,
Expand Down
2 changes: 1 addition & 1 deletion R/class-dgmrp_fit.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Class \code{dgmrp_fit}: a class for fitted models
#' A class for fitted dynamic group MRP models
#'
#' \code{\link{dgmrp}} returns a fitted model object of class \code{dgmrp_fit},
#' which inherits from \code{\link{dgo_fit}}.
Expand Down
2 changes: 1 addition & 1 deletion R/class-dgo_fit.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Class \code{dgo_fit}: a class for fitted models
#' A class for fitted models
#'
#' \code{dgo_fit} is a superclass for \code{\link{dgirt_fit}} and
#' \code{\link{dgmrp_fit}} that inherits from the
Expand Down
4 changes: 2 additions & 2 deletions R/dgirt.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' \code{dgirt} and \code{dgmrp}: fit a DGIRT or single-issue MRP model
#' Fit a dynamic group IRT or single-issue MRP model
#'
#' \code{dgirt} and \code{dgmrp} make calls to \code{\link[rstan]{stan}} with
#' the Stan code and data for their respective models.
Expand Down Expand Up @@ -34,7 +34,7 @@
#' @param hierarchical_model Whether a hierarchical model should be used to
#' smooth the group IRT estimates. If set to FALSE, the model will return raw
#' group-IRT model estimates for each group. Default \code{TRUE}.
#' @param model A Stan model object of class `stanmodel` to be used in
#' @param model A Stan model object of class \code{stanmodel} to be used in
#' estimation. Specifying this argument avoids repeated model compilation. Note
#' that the Stan model object for a model fitted with \code{dgirt()} or
#' \code{dgmrp()} can be found in the the \code{stanmodel} slot of the resulting
Expand Down
19 changes: 7 additions & 12 deletions R/methods-dgirtfit-plot.r
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ utils::globalVariables(c("facet_vars"))
setGeneric("dgirt_plot", signature = "x", function(x, ...)
standardGeneric("dgirt_plot"))

#' \code{dgirt_plot}: plot \code{dgo_fit}-class objects
#' Plot estimates and diagnostic statistics
#'
#' \code{dgirt_plot} plots estimates from a dgo model. \code{plot_rhats} plots
#' split R-hats.
#'
#' @param x A \code{dgo_fit-class} object.
#' @param y_fun Summary function to be plotted as \code{y}.
Expand Down Expand Up @@ -37,15 +40,13 @@ setMethod("dgirt_plot", signature(x = "dgo_fit"),
y_min, y_max)
})

#' \code{dgirt_plot}: plot \code{data.frame} objects
#'
#' @rdname plot-method
#' @param group_names Discrete grouping variables, if any, which will be used as
#' the \code{color} argument in \code{aes}.
#' @param time_name A time variable with numeric values that will be plotted on
#' the x axis.
#' @param geo_name A variable representing local areas that will be used in
#' faceting.
#' @rdname plot-method
#' @export
#' @examples
#' \dontrun{
Expand Down Expand Up @@ -103,12 +104,10 @@ plot_internal <- function(samples, group_names, time_name, geo_name, y_fun,
p
}

#' \code{plot}: plot method for \code{dgo_fit}-class objects
#'
#' @rdname plot-method
#' @param y Ignored.
#' @param ... Further arguments to \code{\link{dgirt_plot}}.
#'
#' @rdname plot-method
#' @export
#' @examples
#' \dontrun{
Expand All @@ -125,15 +124,11 @@ setMethod("plot", signature(x = "dgo_fit", y = "missing"),
setGeneric("plot_rhats", signature = "x", function(x, ...)
standardGeneric("plot_rhats"))

#' \code{plot_rhats}: plot split R-hats from \code{dgo_fit}-class objects
#'
#' This function plots R-hats from a dgirt model.
#'
#' @rdname plot-method
#' @param facet_vars Optionally, one or more variables passed to \code{facet_wrap}
#' @param shape_var,color_var,x_var Optionally, a variable passed to the
#' \code{shape}, \code{color}, or \code{x} arguments of \code{aes_string},
#' respectively.
#' @rdname plot-method
#' @export
#' @examples
#' \dontrun{
Expand Down
2 changes: 1 addition & 1 deletion R/methods-dgirtfit-poststratify.r
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
utils::globalVariables(c("value", "scaled_prop"))

#' \code{poststratify}: reweight and aggregate estimates
#' Reweight and aggregate estimates
#'
#' This function reweights and aggregates estimates from \code{dgirt} for strata
#' defined by modeled variables. The names of each of the model's time,
Expand Down
30 changes: 10 additions & 20 deletions R/methods-dgirtin.r
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
#' @rdname dgirtin-class
setGeneric("summary")

#' Summarize DGIRT Data
#'
#' @rdname dgirtin-class
#' @param x An object of class \code{dgirtIn} as returned by \code{shape}.
#' @param ... Unused.
#' @param object An object of class \code{dgirtIn} as returned by \code{shape}.
#'
#' @rdname dgirtin-class
#' @include class-dgirtin.r
#' @export
setMethod("summary", c(object = "dgirtIn"),
Expand Down Expand Up @@ -48,14 +46,12 @@ setMethod("print", c("x" = "dgirtIn"),
setGeneric("get_item_names", signature = "x",
function(x) standardGeneric("get_item_names"))

#' Get Items Names in DGIRT Data.
#'
#' @rdname dgirtin-class
#' @return A list of item names.
#' @examples
#' data(toy_dgirt_in)
#' get_item_names(toy_dgirt_in)
#' @include class-dgirtin.r
#' @rdname dgirtin-class
#' @aliases get_item_names
#' @export
setMethod("get_item_names", c("x" = "dgirtIn"),
Expand All @@ -69,12 +65,11 @@ setGeneric("get_n", signature = c("x", "by", "aggregate_name"),
function(x, by = NULL, aggregate_name = NULL)
standardGeneric("get_n"))

#' Count Respondents in DGIRT Data.
#'
#' @rdname dgirtin-class
#' @param by The name of a grouping variable.
#' @param aggregate_name If specified `get_n` will operate on the table passed
#' to `shape` as `aggregate_data` instead of on the individual data and count
#' nonmissingness in the given variable.
#' @param aggregate_name If specified \code{get_n} will operate on the table
#' passed to \code{shape} as \code{aggregate_data} instead of on the individual
#' data and count nonmissingness in the given variable.
#'
#' @examples
#' # respondent count
Expand All @@ -87,10 +82,8 @@ setGeneric("get_n", signature = c("x", "by", "aggregate_name"),
#' # respondent count by year and survey identifier
#' get_n(toy_dgirt_in, by = c("year", "source"))
#'
#' @seealso `\link{get_item_n}, \link{get_item_names}`
#' @include class-dgirtin.r
#' @aliases get_n
#' @rdname dgirtin-class
#' @export
setMethod("get_n", c("x" = "dgirtIn"),
function(x, by = NULL, aggregate_name = NULL) {
Expand All @@ -117,17 +110,15 @@ stop_if_no_aggregates <- function(x) {
setGeneric("get_item_n", signature = c("x", "by", "aggregate_data"),
function(x, by = NULL, aggregate_data = FALSE) standardGeneric("get_item_n"))

#' Count Respondents for Items in DGIRT Data
#'
#' @include class-dgirtin.r
#' @rdname dgirtin-class
#' @include class-dgirtin.r
#' @examples
#' data(toy_dgirt_in)
#' get_item_n(toy_dgirt_in)
#' get_item_n(toy_dgirt_in, by = "year")
#' @aliases get_item_n
#' @param aggregate_data If specified `get_item_n` will operate on the table passed
#' to `shape` as `aggregate_data` instead of on the individual data.
#' @param aggregate_data If specified \code{get_item_n} will operate on the table passed
#' to \code{shape} as \code{aggregate_data} instead of on the individual data.
#' @export
setMethod("get_item_n", c("x" = "dgirtIn"),
function(x, by = NULL, aggregate_data = FALSE) {
Expand Down Expand Up @@ -157,8 +148,7 @@ zero_nas <- function(n, by) {
.SDcols = setdiff(names(n), by)]
}

#' Show Summary of DGIRT Data
#' @include class-dgirtin.r
#' @rdname dgirtin-class
#' @include class-dgirtin.r
#' @export
setMethod("show", c("dgirtIn"), function(object) summary(object))
2 changes: 1 addition & 1 deletion R/shape.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' \code{shape}: prepare data for modeling with \code{dgirt} or \code{dgmrp}
#' Prepare data for modeling
#'
#' This function shapes data for use in a dgirt or dgmrp model. Most
#' arguments give the name or names of key variables in the data. These
Expand Down
2 changes: 1 addition & 1 deletion R/toy_dgirt_in.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Class \code{dgirtIn}: a minimal example object
#' A minimal example of shaped data
#'
#' \code{\link[dgo]{shape}} returns a \code{\link[dgo]{dgirtin-class}} object
#' used with \code{\link[dgo]{dgirt}} for DGIRT modeling. \code{toy_dgirt_in} is
Expand Down
2 changes: 1 addition & 1 deletion R/toy_dgirtfit.r
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#' Class \code{dgirtfit}: a minimal example object
#' A minimal example of a fitted model
#'
#' \code{\link[dgo]{dgirt}} returns a \code{\link[dgo]{dgirtfit}}-class object
#' that extends \code{\link[rstan]{stanfit-class}}. \code{toy_dgirtfit} is a
Expand Down
4 changes: 4 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ reference:
contents:
- shape
- toy_dgirt_in
- dgirtin-class
- title: Estimation
contents:
- dgirt
- dgmrp
- toy_dgirtfit
- dgirt_fit-class
- dgmrp_fit-class
- dgo_fit-class
- title: Postestimation
contents:
- poststratify
Expand Down
19 changes: 4 additions & 15 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,11 @@
## Test environments

* local Ubuntu 16.04, R 3.4.0
* Ubuntu 12.04 (on travis-ci), R 3.4.0 (devel, release) and R 3.3.3
* OS X 10.11 and 10.12 (on travis-ci), R 3.4.0 (devel, release) and R 3.3.3
* Windows Server 2012 R2 x64 (on appveyor), R 3.4.0 (devel and release) and R
3.3.3
* Ubuntu 14.04.5 LTS (on travis-ci), R 3.4.2 (devel, release) and R 3.3.3
* macOS 10.12.5 and 10.11.6 (on travis-ci), R 3.4.2 (devel, release) and R 3.3.3
* Windows Server 2012 R2 x64 (on appveyor), R 3.4.2 (release) i386 and x64


## R CMD check results

There were no ERRORs or WARNINGs.
There were no ERRORs, WARNINGs, or NOTEs.

There was one NOTE:

* "Days since last update: 6": This submission attempts to resolve a build
failure (only) on
[r-release-osx-x86_64](https://www.r-project.org/nosvn/R.check/r-release-osx-x86_64/dgo-00check.html)
resulting from a failing test, which does not occur on travis-ci. This
submission avoids using dependency RStan during tests and removes a dependency
on Rcpp. The goal of these changes is to render moot variation in build
environments.
6 changes: 3 additions & 3 deletions docs/reference/dgirt.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

62 changes: 31 additions & 31 deletions docs/reference/dgirt_fit-class.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 25dd83f

Please sign in to comment.