Skip to content

Commit 25dd83f

Browse files
authored
doc tweaks
2 parents 367ade3 + a07effe commit 25dd83f

37 files changed

+198
-229
lines changed

R/class-dgirt_fit.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Class \code{dgirt_fit}: a class for fitted models
1+
#' A class for fitted dynamic group IRT models
22
#'
33
#' \code{\link{dgirt}} returns a fitted model object of class \code{dgirt_fit},
44
#' which inherits from \code{\link{dgo_fit}}.
@@ -29,7 +29,7 @@
2929
#' head(as.data.frame(toy_dgirtfit, pars = 'theta_bar'))
3030
dgirt_fit <- setClass("dgirt_fit", contains = c("dgo_fit"))
3131

32-
#' Class \code{dgirtfit}: a class for fitted models
32+
#' A class for fitted dynamic group IRT models
3333
#'
3434
#' dgo 0.2.8 deprecated the \code{dgirtfit} class and replaced it with the
3535
#' \code{\link{dgirt_fit}} class.

R/class-dgirtin.r

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#' Class \code{dgirtIn}: data prepared for modeling with \code{dgirt}
1+
#' A class for data ready to model
22
#'
3-
#' \code{shape} generates objects of class \code{dgirtIn} for modeling with
4-
#' \code{dgirt} and \code{dgmrp}.
3+
#' \code{shape()} generates objects of class \code{dgirtIn} for modeling with
4+
#' \code{dgirt()} and \code{dgmrp()}.
55
#'
66
#' @aliases dgirtin-class, get_item_n, get_item_names, get_n, dgirtIn-method,
77
#' print.dgirtIn,

R/class-dgmrp_fit.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Class \code{dgmrp_fit}: a class for fitted models
1+
#' A class for fitted dynamic group MRP models
22
#'
33
#' \code{\link{dgmrp}} returns a fitted model object of class \code{dgmrp_fit},
44
#' which inherits from \code{\link{dgo_fit}}.

R/class-dgo_fit.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Class \code{dgo_fit}: a class for fitted models
1+
#' A class for fitted models
22
#'
33
#' \code{dgo_fit} is a superclass for \code{\link{dgirt_fit}} and
44
#' \code{\link{dgmrp_fit}} that inherits from the

R/dgirt.r

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' \code{dgirt} and \code{dgmrp}: fit a DGIRT or single-issue MRP model
1+
#' Fit a dynamic group IRT or single-issue MRP model
22
#'
33
#' \code{dgirt} and \code{dgmrp} make calls to \code{\link[rstan]{stan}} with
44
#' the Stan code and data for their respective models.
@@ -34,7 +34,7 @@
3434
#' @param hierarchical_model Whether a hierarchical model should be used to
3535
#' smooth the group IRT estimates. If set to FALSE, the model will return raw
3636
#' group-IRT model estimates for each group. Default \code{TRUE}.
37-
#' @param model A Stan model object of class `stanmodel` to be used in
37+
#' @param model A Stan model object of class \code{stanmodel} to be used in
3838
#' estimation. Specifying this argument avoids repeated model compilation. Note
3939
#' that the Stan model object for a model fitted with \code{dgirt()} or
4040
#' \code{dgmrp()} can be found in the the \code{stanmodel} slot of the resulting

R/methods-dgirtfit-plot.r

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ utils::globalVariables(c("facet_vars"))
44
setGeneric("dgirt_plot", signature = "x", function(x, ...)
55
standardGeneric("dgirt_plot"))
66

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

40-
#' \code{dgirt_plot}: plot \code{data.frame} objects
41-
#'
43+
#' @rdname plot-method
4244
#' @param group_names Discrete grouping variables, if any, which will be used as
4345
#' the \code{color} argument in \code{aes}.
4446
#' @param time_name A time variable with numeric values that will be plotted on
4547
#' the x axis.
4648
#' @param geo_name A variable representing local areas that will be used in
4749
#' faceting.
48-
#' @rdname plot-method
4950
#' @export
5051
#' @examples
5152
#' \dontrun{
@@ -103,12 +104,10 @@ plot_internal <- function(samples, group_names, time_name, geo_name, y_fun,
103104
p
104105
}
105106

106-
#' \code{plot}: plot method for \code{dgo_fit}-class objects
107-
#'
107+
#' @rdname plot-method
108108
#' @param y Ignored.
109109
#' @param ... Further arguments to \code{\link{dgirt_plot}}.
110110
#'
111-
#' @rdname plot-method
112111
#' @export
113112
#' @examples
114113
#' \dontrun{
@@ -125,15 +124,11 @@ setMethod("plot", signature(x = "dgo_fit", y = "missing"),
125124
setGeneric("plot_rhats", signature = "x", function(x, ...)
126125
standardGeneric("plot_rhats"))
127126

128-
#' \code{plot_rhats}: plot split R-hats from \code{dgo_fit}-class objects
129-
#'
130-
#' This function plots R-hats from a dgirt model.
131-
#'
127+
#' @rdname plot-method
132128
#' @param facet_vars Optionally, one or more variables passed to \code{facet_wrap}
133129
#' @param shape_var,color_var,x_var Optionally, a variable passed to the
134130
#' \code{shape}, \code{color}, or \code{x} arguments of \code{aes_string},
135131
#' respectively.
136-
#' @rdname plot-method
137132
#' @export
138133
#' @examples
139134
#' \dontrun{

R/methods-dgirtfit-poststratify.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
utils::globalVariables(c("value", "scaled_prop"))
22

3-
#' \code{poststratify}: reweight and aggregate estimates
3+
#' Reweight and aggregate estimates
44
#'
55
#' This function reweights and aggregates estimates from \code{dgirt} for strata
66
#' defined by modeled variables. The names of each of the model's time,

R/methods-dgirtin.r

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
#' @rdname dgirtin-class
22
setGeneric("summary")
33

4-
#' Summarize DGIRT Data
5-
#'
4+
#' @rdname dgirtin-class
65
#' @param x An object of class \code{dgirtIn} as returned by \code{shape}.
76
#' @param ... Unused.
87
#' @param object An object of class \code{dgirtIn} as returned by \code{shape}.
98
#'
10-
#' @rdname dgirtin-class
119
#' @include class-dgirtin.r
1210
#' @export
1311
setMethod("summary", c(object = "dgirtIn"),
@@ -48,14 +46,12 @@ setMethod("print", c("x" = "dgirtIn"),
4846
setGeneric("get_item_names", signature = "x",
4947
function(x) standardGeneric("get_item_names"))
5048

51-
#' Get Items Names in DGIRT Data.
52-
#'
49+
#' @rdname dgirtin-class
5350
#' @return A list of item names.
5451
#' @examples
5552
#' data(toy_dgirt_in)
5653
#' get_item_names(toy_dgirt_in)
5754
#' @include class-dgirtin.r
58-
#' @rdname dgirtin-class
5955
#' @aliases get_item_names
6056
#' @export
6157
setMethod("get_item_names", c("x" = "dgirtIn"),
@@ -69,12 +65,11 @@ setGeneric("get_n", signature = c("x", "by", "aggregate_name"),
6965
function(x, by = NULL, aggregate_name = NULL)
7066
standardGeneric("get_n"))
7167

72-
#' Count Respondents in DGIRT Data.
73-
#'
68+
#' @rdname dgirtin-class
7469
#' @param by The name of a grouping variable.
75-
#' @param aggregate_name If specified `get_n` will operate on the table passed
76-
#' to `shape` as `aggregate_data` instead of on the individual data and count
77-
#' nonmissingness in the given variable.
70+
#' @param aggregate_name If specified \code{get_n} will operate on the table
71+
#' passed to \code{shape} as \code{aggregate_data} instead of on the individual
72+
#' data and count nonmissingness in the given variable.
7873
#'
7974
#' @examples
8075
#' # respondent count
@@ -87,10 +82,8 @@ setGeneric("get_n", signature = c("x", "by", "aggregate_name"),
8782
#' # respondent count by year and survey identifier
8883
#' get_n(toy_dgirt_in, by = c("year", "source"))
8984
#'
90-
#' @seealso `\link{get_item_n}, \link{get_item_names}`
9185
#' @include class-dgirtin.r
9286
#' @aliases get_n
93-
#' @rdname dgirtin-class
9487
#' @export
9588
setMethod("get_n", c("x" = "dgirtIn"),
9689
function(x, by = NULL, aggregate_name = NULL) {
@@ -117,17 +110,15 @@ stop_if_no_aggregates <- function(x) {
117110
setGeneric("get_item_n", signature = c("x", "by", "aggregate_data"),
118111
function(x, by = NULL, aggregate_data = FALSE) standardGeneric("get_item_n"))
119112

120-
#' Count Respondents for Items in DGIRT Data
121-
#'
122-
#' @include class-dgirtin.r
123113
#' @rdname dgirtin-class
114+
#' @include class-dgirtin.r
124115
#' @examples
125116
#' data(toy_dgirt_in)
126117
#' get_item_n(toy_dgirt_in)
127118
#' get_item_n(toy_dgirt_in, by = "year")
128119
#' @aliases get_item_n
129-
#' @param aggregate_data If specified `get_item_n` will operate on the table passed
130-
#' to `shape` as `aggregate_data` instead of on the individual data.
120+
#' @param aggregate_data If specified \code{get_item_n} will operate on the table passed
121+
#' to \code{shape} as \code{aggregate_data} instead of on the individual data.
131122
#' @export
132123
setMethod("get_item_n", c("x" = "dgirtIn"),
133124
function(x, by = NULL, aggregate_data = FALSE) {
@@ -157,8 +148,7 @@ zero_nas <- function(n, by) {
157148
.SDcols = setdiff(names(n), by)]
158149
}
159150

160-
#' Show Summary of DGIRT Data
161-
#' @include class-dgirtin.r
162151
#' @rdname dgirtin-class
152+
#' @include class-dgirtin.r
163153
#' @export
164154
setMethod("show", c("dgirtIn"), function(object) summary(object))

R/shape.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' \code{shape}: prepare data for modeling with \code{dgirt} or \code{dgmrp}
1+
#' Prepare data for modeling
22
#'
33
#' This function shapes data for use in a dgirt or dgmrp model. Most
44
#' arguments give the name or names of key variables in the data. These

R/toy_dgirt_in.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Class \code{dgirtIn}: a minimal example object
1+
#' A minimal example of shaped data
22
#'
33
#' \code{\link[dgo]{shape}} returns a \code{\link[dgo]{dgirtin-class}} object
44
#' used with \code{\link[dgo]{dgirt}} for DGIRT modeling. \code{toy_dgirt_in} is

R/toy_dgirtfit.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#' Class \code{dgirtfit}: a minimal example object
1+
#' A minimal example of a fitted model
22
#'
33
#' \code{\link[dgo]{dgirt}} returns a \code{\link[dgo]{dgirtfit}}-class object
44
#' that extends \code{\link[rstan]{stanfit-class}}. \code{toy_dgirtfit} is a

_pkgdown.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@ reference:
1515
contents:
1616
- shape
1717
- toy_dgirt_in
18+
- dgirtin-class
1819
- title: Estimation
1920
contents:
2021
- dgirt
2122
- dgmrp
2223
- toy_dgirtfit
24+
- dgirt_fit-class
25+
- dgmrp_fit-class
26+
- dgo_fit-class
2327
- title: Postestimation
2428
contents:
2529
- poststratify

cran-comments.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,11 @@
11
## Test environments
22

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

97

108
## R CMD check results
119

12-
There were no ERRORs or WARNINGs.
10+
There were no ERRORs, WARNINGs, or NOTEs.
1311

14-
There was one NOTE:
15-
16-
* "Days since last update: 6": This submission attempts to resolve a build
17-
failure (only) on
18-
[r-release-osx-x86_64](https://www.r-project.org/nosvn/R.check/r-release-osx-x86_64/dgo-00check.html)
19-
resulting from a failing test, which does not occur on travis-ci. This
20-
submission avoids using dependency RStan during tests and removes a dependency
21-
on Rcpp. The goal of these changes is to render moot variation in build
22-
environments.

docs/reference/dgirt.html

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/reference/dgirt_fit-class.html

Lines changed: 31 additions & 31 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)