diff --git a/DESCRIPTION b/DESCRIPTION index e37518f2d..280bf4581 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -614,7 +614,6 @@ Suggests: plm, poLCA, psych, - quantreg, rmarkdown, robust, robustbase, diff --git a/NEWS.md b/NEWS.md index 1a0918f71..e2cc9a86b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,8 +1,9 @@ # broom (development version) -* Soft-deprecated tidiers for margins, lsmeans, and emmeans. Each package has been removed from Suggests and is no longer tested---their tidiers will raise a deprecation warning but return the same results as before. +* Soft-deprecated tidiers for margins, lsmeans, emmeans, and quantreg (rq, rqs, nlrq) objects. Each package has been removed from Suggests and is no longer tested---their tidiers will raise a deprecation warning but return the same results as before. - margins was archived from CRAN. In the case that the package is back on CRAN before the next package release, broom will once again Suggest and test support for the package (#1200). - lsmeans and emmeans have a dependency requiring R 4.3.0 or higher. To maintain compatibility with at least 4 previous minor versions of R, broom won't test support for these packages until the release of R 4.7.x (or until lsmeans and emmeans are compatible with the R version 4 minor releases previous, #1193). + - Through its dependency on MatrixModels, and due to CRAN not hosting metadata for Matrix 1.6-x on R 4.1, quantreg requires R 4.4.0 or higher. broom will reintroduce testing (and un-deprecate) for these tidiers when they're once again compatible with R versions through 4 previous minor releases (#1201). * While this broom release contains no changes to the `tidy.survfit()` method for objects from the survival package, the package has bumped the minimum required version for survival. Before survival 3.6-4, `tidy.survfit()` propagated "inconsistent" `n.censor` values from survival for multi-state models (#1195). diff --git a/R/quantreg-nlrq-tidiers.R b/R/quantreg-nlrq-tidiers.R index ed5bffb0e..fd65c1026 100644 --- a/R/quantreg-nlrq-tidiers.R +++ b/R/quantreg-nlrq-tidiers.R @@ -1,7 +1,7 @@ #' @templateVar class nlrq #' @template title_desc_tidy #' -#' @param x A `nlrq` object returned from [quantreg::nlrq()]. +#' @param x A `nlrq` object returned from `quantreg::nlrq()`. #' @template param_confint #' @template param_unused_dots #' @@ -9,30 +9,41 @@ #' #' @aliases nlrq_tidiers #' @export -#' @seealso [tidy()], [quantreg::nlrq()] +#' @seealso [tidy()], `quantreg::nlrq()` #' @family quantreg tidiers -#' @examplesIf rlang::is_installed("quantreg") -#' -#' # load modeling library -#' library(quantreg) -#' -#' # build artificial data with multiplicative error -#' set.seed(1) -#' dat <- NULL -#' dat$x <- rep(1:25, 20) -#' dat$y <- SSlogis(dat$x, 10, 12, 2) * rnorm(500, 1, 0.1) -#' -#' # fit the median using nlrq -#' mod <- nlrq(y ~ SSlogis(x, Asym, mid, scal), -#' data = dat, tau = 0.5, trace = TRUE -#' ) -#' -#' # summarize model fit with tidiers -#' tidy(mod) -#' glance(mod) -#' augment(mod) -#' +# qunatreg not available (#1201) +# @examplesIf rlang::is_installed("quantreg") +# +# # load modeling library +# library(quantreg) +# +# # build artificial data with multiplicative error +# set.seed(1) +# dat <- NULL +# dat$x <- rep(1:25, 20) +# dat$y <- SSlogis(dat$x, 10, 12, 2) * rnorm(500, 1, 0.1) +# +# # fit the median using nlrq +# mod <- nlrq(y ~ SSlogis(x, Asym, mid, scal), +# data = dat, tau = 0.5, trace = TRUE +# ) +# +# # summarize model fit with tidiers +# tidy(mod) +# glance(mod) +# augment(mod) +# tidy.nlrq <- function(x, conf.int = FALSE, conf.level = 0.95, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `nlrq` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + check_ellipses("exponentiate", "tidy", "nlrq", ...) ret <- as_tidy_tibble( @@ -64,10 +75,20 @@ tidy.nlrq <- function(x, conf.int = FALSE, conf.level = 0.95, ...) { #' ) #' #' @export -#' @seealso [glance()], [quantreg::nlrq()] +#' @seealso [glance()], `quantreg::nlrq()` #' @family quantreg tidiers #' @inherit tidy.nlrq examples glance.nlrq <- function(x, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `nlrq` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + n <- length(x[["m"]]$fitted()) s <- summary(x) @@ -84,11 +105,11 @@ glance.nlrq <- function(x, ...) { #' @templateVar class nlrq #' @template title_desc_tidy #' -#' @param x A `nlrq` object returned from [quantreg::nlrq()]. +#' @param x A `nlrq` object returned from `quantreg::nlrq()`. #' @inherit augment.nls params examples return #' #' @export -#' @seealso [augment()], [quantreg::nlrq()] +#' @seealso [augment()], `quantreg::nlrq()` #' @family quantreg tidiers #' @include stats-nls-tidiers.R #' diff --git a/R/quantreg-rq-tidiers.R b/R/quantreg-rq-tidiers.R index 131afea46..1180ac640 100644 --- a/R/quantreg-rq-tidiers.R +++ b/R/quantreg-rq-tidiers.R @@ -1,13 +1,13 @@ #' @templateVar class rq #' @template title_desc_tidy #' -#' @param x An `rq` object returned from [quantreg::rq()]. +#' @param x An `rq` object returned from `quantreg::rq()`. #' @param se.type Character specifying the method to use to calculate -#' standard errors. Passed to [quantreg::summary.rq()] `se` argument. +#' standard errors. Passed to `quantreg::summary.rq()` `se` argument. #' Defaults to `"rank"` if the sample size is less than 1000, #' otherwise defaults to `"nid"`. #' @template param_confint -#' @param ... Additional arguments passed to [quantreg::summary.rq()]. +#' @param ... Additional arguments passed to `quantreg::summary.rq()`. #' #' @details If `se.type = "rank"` confidence intervals are calculated by #' `summary.rq` and `statistic` and `p.value` values are not returned. @@ -19,42 +19,53 @@ #' #' @aliases rq_tidiers quantreg_tidiers #' @export -#' @seealso [tidy()], [quantreg::rq()] +#' @seealso [tidy()], `quantreg::rq()` #' @family quantreg tidiers #' -#' @examplesIf rlang::is_installed("quantreg") -#' -#' # load modeling library and data -#' library(quantreg) -#' -#' data(stackloss) -#' -#' # median (l1) regression fit for the stackloss data. -#' mod1 <- rq(stack.loss ~ stack.x, .5) -#' -#' # weighted sample median -#' mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) -#' -#' # summarize model fit with tidiers -#' tidy(mod1) -#' glance(mod1) -#' augment(mod1) -#' -#' tidy(mod2) -#' glance(mod2) -#' augment(mod2) -#' -#' # varying tau to generate an rqs object -#' mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) -#' -#' tidy(mod3) -#' augment(mod3) -#' -#' # glance cannot handle rqs objects like `mod3`--use a purrr -#' # `map`-based workflow instead -#' +# quantreg not available (#1201) +# @examplesIf rlang::is_installed("quantreg") +# +# # load modeling library and data +# library(quantreg) +# +# data(stackloss) +# +# # median (l1) regression fit for the stackloss data. +# mod1 <- rq(stack.loss ~ stack.x, .5) +# +# # weighted sample median +# mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) +# +# # summarize model fit with tidiers +# tidy(mod1) +# glance(mod1) +# augment(mod1) +# +# tidy(mod2) +# glance(mod2) +# augment(mod2) +# +# # varying tau to generate an rqs object +# mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) +# +# tidy(mod3) +# augment(mod3) +# +# # glance cannot handle rqs objects like `mod3`--use a purrr +# # `map`-based workflow instead +# tidy.rq <- function(x, se.type = NULL, conf.int = FALSE, conf.level = 0.95, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `rq` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + check_ellipses("exponentiate", "tidy", "rq", ...) # specification for confidence level inverted for summary.rq @@ -68,7 +79,7 @@ tidy.rq <- function(x, se.type = NULL, conf.int = FALSE, # summary.rq often issues warnings when computing standard error rq_summary <- suppressWarnings( - quantreg::summary.rq(x, se = se.type, alpha = alpha, ...) + summary(x, se = se.type, alpha = alpha, ...) ) process_rq( @@ -105,6 +116,16 @@ tidy.rq <- function(x, se.type = NULL, conf.int = FALSE, #' @seealso [glance()], [quantreg::rq()] #' @family quantreg tidiers glance.rq <- function(x, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `rq` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + n <- length(fitted(x)) s <- summary(x) @@ -121,7 +142,7 @@ glance.rq <- function(x, ...) { #' @templateVar class rq #' @template title_desc_augment #' -#' @param x An `rq` object returned from [quantreg::rq()]. +#' @param x An `rq` object returned from `quantreg::rq()`. #' @template param_data #' @template param_newdata #' @inheritDotParams quantreg::predict.rq @@ -136,9 +157,19 @@ glance.rq <- function(x, ...) { #' intervals when data is specified via the `newdata` argument. #' #' @export -#' @seealso [augment], [quantreg::rq()], [quantreg::predict.rq()] +#' @seealso [augment], `quantreg::rq()`, `quantreg::predict.rq()` #' @family quantreg tidiers augment.rq <- function(x, data = model.frame(x), newdata = NULL, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `rq` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + args <- list(...) force_newdata <- FALSE if ("interval" %in% names(args) && args[["interval"]] != "none") { diff --git a/R/quantreg-rqs-tidiers.R b/R/quantreg-rqs-tidiers.R index 5cbb1f44f..69e77adc9 100644 --- a/R/quantreg-rqs-tidiers.R +++ b/R/quantreg-rqs-tidiers.R @@ -1,12 +1,12 @@ #' @templateVar class rqs #' @template title_desc_tidy #' -#' @param x An `rqs` object returned from [quantreg::rq()]. +#' @param x An `rqs` object returned from `quantreg::rq()`. #' @param se.type Character specifying the method to use to calculate -#' standard errors. Passed to [quantreg::summary.rq()] `se` argument. +#' standard errors. Passed to `quantreg::summary.rq()` `se` argument. #' Defaults to `"rank"`. #' @template param_confint -#' @param ... Additional arguments passed to [quantreg::summary.rqs()] +#' @param ... Additional arguments passed to `quantreg::summary.rqs()` #' #' @evalRd return_tidy(regression = TRUE, #' quantile = "Linear conditional quantile.") @@ -18,16 +18,26 @@ #' #' @aliases rqs_tidiers #' @export -#' @seealso [tidy()], [quantreg::rq()] +#' @seealso [tidy()], `quantreg::rq()` #' @family quantreg tidiers #' @inherit tidy.rq examples #' tidy.rqs <- function(x, se.type = "rank", conf.int = FALSE, conf.level = 0.95, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `rqs` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + check_ellipses("exponentiate", "tidy", "rqs", ...) rq_summary <- suppressWarnings( - quantreg::summary.rqs(x, se = se.type, alpha = 1 - conf.level, ...) + summary(x, se = se.type, alpha = 1 - conf.level, ...) ) purrr::map_df( @@ -54,16 +64,26 @@ glance.rqs <- function(x, ...) { #' @inherit tidy.rqs examples #' @inherit augment.rq return details #' -#' @param x An `rqs` object returned from [quantreg::rq()]. +#' @param x An `rqs` object returned from `quantreg::rq()`. #' @template param_data #' @template param_newdata #' @inheritDotParams quantreg::predict.rq #' #' @export -#' @seealso [augment], [quantreg::rq()], [quantreg::predict.rqs()] +#' @seealso [augment], `quantreg::rq()`, `quantreg::predict.rqs()` #' @family quantreg tidiers #' @inherit tidy.rq examples augment.rqs <- function(x, data = model.frame(x), newdata, ...) { + lifecycle::deprecate_soft( + "1.0.6", + I("tidying an `rqs` object"), + details = c( + "i" = "broom no longer tests support for quantreg output as the package + requires an incompatibly recent R version.", + "!" = "Please interpret output with caution." + ) + ) + n_tau <- length(x[["tau"]]) if (missing(newdata) || is.null(newdata)) { original <- data[rep(seq_len(nrow(data)), each = n_tau), , drop = FALSE] diff --git a/man/augment.nlrq.Rd b/man/augment.nlrq.Rd index a2704cac7..e0792c428 100644 --- a/man/augment.nlrq.Rd +++ b/man/augment.nlrq.Rd @@ -7,7 +7,7 @@ \method{augment}{nlrq}(x, data = NULL, newdata = NULL, ...) } \arguments{ -\item{x}{A \code{nlrq} object returned from \code{\link[quantreg:nlrq]{quantreg::nlrq()}}.} +\item{x}{A \code{nlrq} object returned from \code{quantreg::nlrq()}.} \item{data}{A \link[base:data.frame]{base::data.frame} or \code{\link[tibble:tibble]{tibble::tibble()}} containing the original data that was used to produce the object \code{x}. Defaults to @@ -67,7 +67,7 @@ augment(n, newdata = newdata) \dontshow{\}) # examplesIf} } \seealso{ -\code{\link[=augment]{augment()}}, \code{\link[quantreg:nlrq]{quantreg::nlrq()}} +\code{\link[=augment]{augment()}}, \code{quantreg::nlrq()} Other quantreg tidiers: \code{\link{augment.rqs}()}, diff --git a/man/augment.rq.Rd b/man/augment.rq.Rd index e2a65099e..5c6c93a70 100644 --- a/man/augment.rq.Rd +++ b/man/augment.rq.Rd @@ -7,7 +7,7 @@ \method{augment}{rq}(x, data = model.frame(x), newdata = NULL, ...) } \arguments{ -\item{x}{An \code{rq} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.} +\item{x}{An \code{rq} object returned from \code{quantreg::rq()}.} \item{data}{A \link[base:data.frame]{base::data.frame} or \code{\link[tibble:tibble]{tibble::tibble()}} containing the original data that was used to produce the object \code{x}. Defaults to @@ -91,41 +91,8 @@ a confidence interval is also calculated on the fitted values resulting in columns \code{.lower} and \code{.upper}. Does not provide confidence intervals when data is specified via the \code{newdata} argument. } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library and data -library(quantreg) - -data(stackloss) - -# median (l1) regression fit for the stackloss data. -mod1 <- rq(stack.loss ~ stack.x, .5) - -# weighted sample median -mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) - -# summarize model fit with tidiers -tidy(mod1) -glance(mod1) -augment(mod1) - -tidy(mod2) -glance(mod2) -augment(mod2) - -# varying tau to generate an rqs object -mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) - -tidy(mod3) -augment(mod3) - -# glance cannot handle rqs objects like `mod3`--use a purrr -# `map`-based workflow instead -\dontshow{\}) # examplesIf} -} \seealso{ -\link{augment}, \code{\link[quantreg:rq]{quantreg::rq()}}, \code{\link[quantreg:predict.rq]{quantreg::predict.rq()}} +\link{augment}, \code{quantreg::rq()}, \code{quantreg::predict.rq()} Other quantreg tidiers: \code{\link{augment.nlrq}()}, diff --git a/man/augment.rqs.Rd b/man/augment.rqs.Rd index 7bf3a4306..9f75e96f2 100644 --- a/man/augment.rqs.Rd +++ b/man/augment.rqs.Rd @@ -7,7 +7,7 @@ \method{augment}{rqs}(x, data = model.frame(x), newdata, ...) } \arguments{ -\item{x}{An \code{rqs} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.} +\item{x}{An \code{rqs} object returned from \code{quantreg::rq()}.} \item{data}{A \link[base:data.frame]{base::data.frame} or \code{\link[tibble:tibble]{tibble::tibble()}} containing the original data that was used to produce the object \code{x}. Defaults to @@ -91,41 +91,8 @@ a confidence interval is also calculated on the fitted values resulting in columns \code{.lower} and \code{.upper}. Does not provide confidence intervals when data is specified via the \code{newdata} argument. } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library and data -library(quantreg) - -data(stackloss) - -# median (l1) regression fit for the stackloss data. -mod1 <- rq(stack.loss ~ stack.x, .5) - -# weighted sample median -mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) - -# summarize model fit with tidiers -tidy(mod1) -glance(mod1) -augment(mod1) - -tidy(mod2) -glance(mod2) -augment(mod2) - -# varying tau to generate an rqs object -mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) - -tidy(mod3) -augment(mod3) - -# glance cannot handle rqs objects like `mod3`--use a purrr -# `map`-based workflow instead -\dontshow{\}) # examplesIf} -} \seealso{ -\link{augment}, \code{\link[quantreg:rq]{quantreg::rq()}}, \code{\link[quantreg:predict.rq]{quantreg::predict.rqs()}} +\link{augment}, \code{quantreg::rq()}, \code{quantreg::predict.rqs()} Other quantreg tidiers: \code{\link{augment.nlrq}()}, diff --git a/man/glance.nlrq.Rd b/man/glance.nlrq.Rd index e53ac4deb..653682db6 100644 --- a/man/glance.nlrq.Rd +++ b/man/glance.nlrq.Rd @@ -7,7 +7,7 @@ \method{glance}{nlrq}(x, ...) } \arguments{ -\item{x}{A \code{nlrq} object returned from \code{\link[quantreg:nlrq]{quantreg::nlrq()}}.} +\item{x}{A \code{nlrq} object returned from \code{quantreg::nlrq()}.} \item{...}{Additional arguments. Not used. Needed to match generic signature only. \strong{Cautionary note:} Misspelled arguments will be @@ -42,31 +42,8 @@ model matrix is rank-deficient or not. If so, entries in columns that no longer have a well-defined value are filled in with an \code{NA} of the appropriate type. } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library -library(quantreg) - -# build artificial data with multiplicative error -set.seed(1) -dat <- NULL -dat$x <- rep(1:25, 20) -dat$y <- SSlogis(dat$x, 10, 12, 2) * rnorm(500, 1, 0.1) - -# fit the median using nlrq -mod <- nlrq(y ~ SSlogis(x, Asym, mid, scal), - data = dat, tau = 0.5, trace = TRUE -) - -# summarize model fit with tidiers -tidy(mod) -glance(mod) -augment(mod) -\dontshow{\}) # examplesIf} -} \seealso{ -\code{\link[=glance]{glance()}}, \code{\link[quantreg:nlrq]{quantreg::nlrq()}} +\code{\link[=glance]{glance()}}, \code{quantreg::nlrq()} Other quantreg tidiers: \code{\link{augment.nlrq}()}, diff --git a/man/glance.rq.Rd b/man/glance.rq.Rd index f35dabcfa..0292415f4 100644 --- a/man/glance.rq.Rd +++ b/man/glance.rq.Rd @@ -7,7 +7,7 @@ \method{glance}{rq}(x, ...) } \arguments{ -\item{x}{An \code{rq} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.} +\item{x}{An \code{rq} object returned from \code{quantreg::rq()}.} \item{...}{Additional arguments. Not used. Needed to match generic signature only. \strong{Cautionary note:} Misspelled arguments will be @@ -51,39 +51,6 @@ For multiple values, please use a \code{\link[purrr:map]{purrr::map()}} workflow map_dfr(glance) }\if{html}{\out{}} } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library and data -library(quantreg) - -data(stackloss) - -# median (l1) regression fit for the stackloss data. -mod1 <- rq(stack.loss ~ stack.x, .5) - -# weighted sample median -mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) - -# summarize model fit with tidiers -tidy(mod1) -glance(mod1) -augment(mod1) - -tidy(mod2) -glance(mod2) -augment(mod2) - -# varying tau to generate an rqs object -mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) - -tidy(mod3) -augment(mod3) - -# glance cannot handle rqs objects like `mod3`--use a purrr -# `map`-based workflow instead -\dontshow{\}) # examplesIf} -} \seealso{ \code{\link[=glance]{glance()}}, \code{\link[quantreg:rq]{quantreg::rq()}} diff --git a/man/tidy.nlrq.Rd b/man/tidy.nlrq.Rd index a61454024..be46cf456 100644 --- a/man/tidy.nlrq.Rd +++ b/man/tidy.nlrq.Rd @@ -8,7 +8,7 @@ \method{tidy}{nlrq}(x, conf.int = FALSE, conf.level = 0.95, ...) } \arguments{ -\item{x}{A \code{nlrq} object returned from \code{\link[quantreg:nlrq]{quantreg::nlrq()}}.} +\item{x}{A \code{nlrq} object returned from \code{quantreg::nlrq()}.} \item{conf.int}{Logical indicating whether or not to include a confidence interval in the tidied output. Defaults to \code{FALSE}.} @@ -38,31 +38,8 @@ model component varies across models but is usually self-evident. If a model has several distinct types of components, you will need to specify which components to return. } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library -library(quantreg) - -# build artificial data with multiplicative error -set.seed(1) -dat <- NULL -dat$x <- rep(1:25, 20) -dat$y <- SSlogis(dat$x, 10, 12, 2) * rnorm(500, 1, 0.1) - -# fit the median using nlrq -mod <- nlrq(y ~ SSlogis(x, Asym, mid, scal), - data = dat, tau = 0.5, trace = TRUE -) - -# summarize model fit with tidiers -tidy(mod) -glance(mod) -augment(mod) -\dontshow{\}) # examplesIf} -} \seealso{ -\code{\link[=tidy]{tidy()}}, \code{\link[quantreg:nlrq]{quantreg::nlrq()}} +\code{\link[=tidy]{tidy()}}, \code{quantreg::nlrq()} Other quantreg tidiers: \code{\link{augment.nlrq}()}, diff --git a/man/tidy.rq.Rd b/man/tidy.rq.Rd index 962001ba2..f50cfa4f7 100644 --- a/man/tidy.rq.Rd +++ b/man/tidy.rq.Rd @@ -9,10 +9,10 @@ \method{tidy}{rq}(x, se.type = NULL, conf.int = FALSE, conf.level = 0.95, ...) } \arguments{ -\item{x}{An \code{rq} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.} +\item{x}{An \code{rq} object returned from \code{quantreg::rq()}.} \item{se.type}{Character specifying the method to use to calculate -standard errors. Passed to \code{\link[quantreg:summary.rq]{quantreg::summary.rq()}} \code{se} argument. +standard errors. Passed to \code{quantreg::summary.rq()} \code{se} argument. Defaults to \code{"rank"} if the sample size is less than 1000, otherwise defaults to \code{"nid"}.} @@ -23,7 +23,7 @@ interval in the tidied output. Defaults to \code{FALSE}.} if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.} -\item{...}{Additional arguments passed to \code{\link[quantreg:summary.rq]{quantreg::summary.rq()}}.} +\item{...}{Additional arguments passed to \code{quantreg::summary.rq()}.} } \description{ Tidy summarizes information about the components of a model. @@ -40,41 +40,8 @@ When only a single predictor is included in the model, no confidence intervals are calculated and the confidence limits are set to NA. } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library and data -library(quantreg) - -data(stackloss) - -# median (l1) regression fit for the stackloss data. -mod1 <- rq(stack.loss ~ stack.x, .5) - -# weighted sample median -mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) - -# summarize model fit with tidiers -tidy(mod1) -glance(mod1) -augment(mod1) - -tidy(mod2) -glance(mod2) -augment(mod2) - -# varying tau to generate an rqs object -mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) - -tidy(mod3) -augment(mod3) - -# glance cannot handle rqs objects like `mod3`--use a purrr -# `map`-based workflow instead -\dontshow{\}) # examplesIf} -} \seealso{ -\code{\link[=tidy]{tidy()}}, \code{\link[quantreg:rq]{quantreg::rq()}} +\code{\link[=tidy]{tidy()}}, \code{quantreg::rq()} Other quantreg tidiers: \code{\link{augment.nlrq}()}, diff --git a/man/tidy.rqs.Rd b/man/tidy.rqs.Rd index dd594dec5..3c5649678 100644 --- a/man/tidy.rqs.Rd +++ b/man/tidy.rqs.Rd @@ -8,10 +8,10 @@ \method{tidy}{rqs}(x, se.type = "rank", conf.int = FALSE, conf.level = 0.95, ...) } \arguments{ -\item{x}{An \code{rqs} object returned from \code{\link[quantreg:rq]{quantreg::rq()}}.} +\item{x}{An \code{rqs} object returned from \code{quantreg::rq()}.} \item{se.type}{Character specifying the method to use to calculate -standard errors. Passed to \code{\link[quantreg:summary.rq]{quantreg::summary.rq()}} \code{se} argument. +standard errors. Passed to \code{quantreg::summary.rq()} \code{se} argument. Defaults to \code{"rank"}.} \item{conf.int}{Logical indicating whether or not to include a confidence @@ -21,7 +21,7 @@ interval in the tidied output. Defaults to \code{FALSE}.} if \code{conf.int = TRUE}. Must be strictly greater than 0 and less than 1. Defaults to 0.95, which corresponds to a 95 percent confidence interval.} -\item{...}{Additional arguments passed to \code{\link[quantreg:summary.rq]{quantreg::summary.rqs()}}} +\item{...}{Additional arguments passed to \code{quantreg::summary.rqs()}} } \description{ Tidy summarizes information about the components of a model. @@ -37,41 +37,8 @@ If \code{se.type = "rank"} confidence intervals are calculated by no confidence intervals are calculated and the confidence limits are set to NA. } -\examples{ -\dontshow{if (rlang::is_installed("quantreg")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} - -# load modeling library and data -library(quantreg) - -data(stackloss) - -# median (l1) regression fit for the stackloss data. -mod1 <- rq(stack.loss ~ stack.x, .5) - -# weighted sample median -mod2 <- rq(rnorm(50) ~ 1, weights = runif(50)) - -# summarize model fit with tidiers -tidy(mod1) -glance(mod1) -augment(mod1) - -tidy(mod2) -glance(mod2) -augment(mod2) - -# varying tau to generate an rqs object -mod3 <- rq(stack.loss ~ stack.x, tau = c(.25, .5)) - -tidy(mod3) -augment(mod3) - -# glance cannot handle rqs objects like `mod3`--use a purrr -# `map`-based workflow instead -\dontshow{\}) # examplesIf} -} \seealso{ -\code{\link[=tidy]{tidy()}}, \code{\link[quantreg:rq]{quantreg::rq()}} +\code{\link[=tidy]{tidy()}}, \code{quantreg::rq()} Other quantreg tidiers: \code{\link{augment.nlrq}()}, diff --git a/tests/testthat/test-quantreg-nlrq.R b/tests/testthat/test-quantreg-nlrq.R index 0ac21f381..2fdd076d9 100644 --- a/tests/testthat/test-quantreg-nlrq.R +++ b/tests/testthat/test-quantreg-nlrq.R @@ -5,8 +5,9 @@ skip_on_cran() skip_if_not_installed("modeltests") library(modeltests) -skip_if_not_installed("quantreg") -library(quantreg) +skip("quantreg not available (#1201)") +# skip_if_not_installed("quantreg") +# library(quantreg) set.seed(27) diff --git a/tests/testthat/test-quantreg-rq.R b/tests/testthat/test-quantreg-rq.R index 919e133a5..a543db3c5 100644 --- a/tests/testthat/test-quantreg-rq.R +++ b/tests/testthat/test-quantreg-rq.R @@ -5,8 +5,9 @@ skip_on_cran() skip_if_not_installed("modeltests") library(modeltests) -skip_if_not_installed("quantreg") -library(quantreg) +skip("quantreg not available (#1201)") +# skip_if_not_installed("quantreg") +# library(quantreg) data(stackloss) diff --git a/tests/testthat/test-quantreg-rqs.R b/tests/testthat/test-quantreg-rqs.R index a8232e296..86b763504 100644 --- a/tests/testthat/test-quantreg-rqs.R +++ b/tests/testthat/test-quantreg-rqs.R @@ -5,8 +5,9 @@ skip_on_cran() skip_if_not_installed("modeltests") library(modeltests) -skip_if_not_installed("quantreg") -library(quantreg) +skip("quantreg not available (#1201)") +# skip_if_not_installed("quantreg") +# library(quantreg) airquality <- na.omit(airquality)