Skip to content

Commit df58ece

Browse files
committed
fix duplicate @return for glance/tidy
1 parent d03d882 commit df58ece

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

CRAN-SUBMISSION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Version: 0.2.1
2-
Date: 2023-05-11 16:40:33 UTC
3-
SHA: 4c83faaae5fa16984c904e6e2988d378117e04cc
2+
Date: 2023-05-12 15:10:14 UTC
3+
SHA: d03d882fa8a7636e55850f36fafe9715effe9d37

R/nestedMethods.R

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#' @param subset optional updated subset argument.
4646
#' @param contrasts optional updated contrasts argument.
4747
#' @param \dots arguments to be passed down.
48-
#'
48+
#'
4949
#' @return \itemize{
5050
#' \item The \code{coef} and \code{vcov} methods return either matrices or lists of regression
5151
#' coefficients and their covariances, respectively.
@@ -54,7 +54,6 @@
5454
#' \item The \code{predict} and \code{fitted} methods return either a matrix of predicted probabilities or an
5555
#' object of class \code{"predictDichotomies"}, which is a named list with predicted logits for
5656
#' each nested-dichotomy model.
57-
#' \item The \code{glance} and \code{tidy} methods return 'tibbles' containing model summaries.
5857
#' \item The \code{summary} method returns an object of class \code{"summary.nestedLogit"}, which is
5958
#' a list of summaries of the \code{\link{glm}} objects that comprise the nested-dichotomies model; the
6059
#' object is normally printed.
@@ -92,7 +91,7 @@
9291
#' broom::tidy(m)
9392
#'
9493
#' # predicted probabilities and ploting
95-
#' head(predict(m)) # fitted probabilities for first few cases;
94+
#' head(predict(m)) # fitted probabilities for first few cases;
9695
#' # equivalent to head(fitted(m))
9796
#' new <- expand.grid(parentdeg=c("l.t.highschool", "highschool",
9897
#' "college", "graduate"),
@@ -121,7 +120,7 @@ print.nestedLogit <- function(x, ...) {
121120
summary.nestedLogit <- function(object, ...) {
122121
result <- lapply(models(object), summary, ...)
123122
for (i in seq_along(result)) {
124-
result[[i]]$dichotomy <- models(object, i)$dichotomy
123+
result[[i]]$dichotomy <- models(object, i)$dichotomy
125124
}
126125
class(result) <- "summary.nestedLogit"
127126
attr(result, "formula") <- object$formula
@@ -187,7 +186,7 @@ predict.nestedLogit <- function(object, newdata, model=c("nested", "dichotomies"
187186
for (i in seq_along(models(object))) {
188187
p <- predict(models(object, i), newdata = newdata, type = "response")
189188
p <- cbind(1 - p, p)
190-
attr(p, "columns") <- models(object, i)$dichotomy
189+
attr(p, "columns") <- models(object, i)$dichotomy
191190
fitted[[i]] <- p
192191
}
193192
response.levels <-
@@ -197,7 +196,7 @@ predict.nestedLogit <- function(object, newdata, model=c("nested", "dichotomies"
197196
colnames(p) <- response.levels
198197
for (level in response.levels) {
199198
for (i in seq_along(models(object))) {
200-
which <- sapply(models(object, i)$dichotomy, function(x)
199+
which <- sapply(models(object, i)$dichotomy, function(x)
201200
level %in% x)
202201
if (!any(which))
203202
next
@@ -319,7 +318,7 @@ as.character.dichotomies <- function(x, ...) {
319318
for (i in seq_along(x)) {
320319
result <- paste0(result,
321320
names(x[i]), " = ",
322-
"{",
321+
"{",
323322
names(x[[i]][1L]),
324323
"{",
325324
paste(x[[i]][[1L]], collapse = " "),

0 commit comments

Comments
 (0)