From 3ef5743afec8117ad1f9e62e5f1628d377dcaaeb Mon Sep 17 00:00:00 2001 From: Ben Bolker Date: Tue, 5 Feb 2019 09:28:45 -0500 Subject: [PATCH] various cleanup, version bump --- DESCRIPTION | 2 +- R/glmmTMB_tidiers.R | 3 ++- R/lme4_tidiers.R | 14 +++++++------- inst/NEWS.Rd | 16 +++++++++++++++- man/augment.ranef.mer.Rd | 12 ++++++------ tests/testthat/test-lme4.R | 1 + 6 files changed, 32 insertions(+), 16 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 678ad39..01a4f7e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Package: broom.mixed Type: Package Title: Tidying Methods for Mixed Models -Version: 0.2.3.9000 +Version: 0.2.4 Authors@R: c( person("Ben", "Bolker", email = "bolker@mcmaster.ca", role = c("aut", "cre"), diff --git a/R/glmmTMB_tidiers.R b/R/glmmTMB_tidiers.R index 657e295..06525e0 100644 --- a/R/glmmTMB_tidiers.R +++ b/R/glmmTMB_tidiers.R @@ -87,7 +87,8 @@ tidy.glmmTMB <- function(x, effects = c("ran_pars", "fixed"), ## - avoid (as.)data.frame ## R CMD check false positives - term <- estimate <- .id <- level <- std.error <- . <- NULL + condsd <- condval <- grp <- grpvar <- + term <- estimate <- .id <- level <- std.error <- . <- NULL drop.missing <- function(x) x[vapply(x,length,numeric(1))>0] ss <- stats::coef(summary(x)) diff --git a/R/lme4_tidiers.R b/R/lme4_tidiers.R index befe347..cecb269 100644 --- a/R/lme4_tidiers.R +++ b/R/lme4_tidiers.R @@ -342,7 +342,7 @@ augment.merMod <- function(x, data = stats::model.frame(x), newdata, ...) { if (missing(newdata)) { newdata <- NULL } - ret <- augment_columns(x, data, newdata, se.fit = NULL, ...) + ret <- suppressMessages(augment_columns(x, data, newdata, se.fit = NULL, ...)) # add predictions with no random effects (population means) predictions <- stats::predict(x, re.form = NA) @@ -420,12 +420,12 @@ glance.merMod <- function(x, ...) { ##' geom_vline(xintercept=0,lty=2)+ ##' geom_point()+facet_wrap(~variable,scale="free_x") ##' ## emphasize extreme values -##' aa2 <- aa %>% group_by(grp,level) %>% -##' mutate(keep=any(estimate/std.error>2)) -##' ## Update caterpillar plot with extreme levels highlighted -##' ## (highlight all groups with *either* extreme intercept *or* -##' ## extreme slope) -##' ggplot(aa2,aes(estimate,level,xmin=lb,xmax=ub,colour=factor(keep)))+ +##' aa2 <- group_by(aa,grp,level) +##' aa3 <- mutate(aa2, keep=any(estimate/std.error>2)) +##' ## Update caterpillar plot with extreme levels highlighted +##' ## (highlight all groups with *either* extreme intercept *or* +##' ## extreme slope) +##' ggplot(aa3, aes(estimate,level,xmin=lb,xmax=ub,colour=factor(keep)))+ ##' geom_errorbarh(height=0)+ ##' geom_vline(xintercept=0,lty=2)+ ##' geom_point()+facet_wrap(~variable,scale="free_x")+ diff --git a/inst/NEWS.Rd b/inst/NEWS.Rd index 12d5660..efd7293 100644 --- a/inst/NEWS.Rd +++ b/inst/NEWS.Rd @@ -4,6 +4,20 @@ \title{broom.mixed News} \encoding{UTF-8} +\section{CHANGES IN VERSION 0.2.4}{ + \subsection{NEW FEATURES}{ + \itemize{ + \item \code{gls} tidier gets confint (GH #49) + } + } + \subsection{BUG FIXES}{ + \itemize{ + \item misc fixes for \code{lme4} tidiers (confint for ran_vals, profile conf intervals fixed) + \item ran_vals works for \code{glmmTMB} + } + } +} + \section{CHANGES IN VERSION 0.2.3}{ \subsection{BUG FIXES}{ \itemize{ @@ -12,7 +26,7 @@ \item component argument works for random effects in glmmTMB (GH #33: @strengejacke) } } - \subsection{NEW FIXES}{ + \subsection{NEW FEATURES}{ \itemize{ \item \code{brmsfit} and \code{rstanarm} methods allow \code{conf.method="HPDinterval"} diff --git a/man/augment.ranef.mer.Rd b/man/augment.ranef.mer.Rd index 0c63752..e2ab8ed 100644 --- a/man/augment.ranef.mer.Rd +++ b/man/augment.ranef.mer.Rd @@ -37,12 +37,12 @@ if (require("lme4")) { geom_vline(xintercept=0,lty=2)+ geom_point()+facet_wrap(~variable,scale="free_x") ## emphasize extreme values - aa2 <- aa \%>\% group_by(grp,level) \%>\% - mutate(keep=any(estimate/std.error>2)) - ## Update caterpillar plot with extreme levels highlighted - ## (highlight all groups with *either* extreme intercept *or* - ## extreme slope) - ggplot(aa2,aes(estimate,level,xmin=lb,xmax=ub,colour=factor(keep)))+ + aa2 <- group_by(aa,grp,level) + aa3 <- mutate(aa2, keep=any(estimate/std.error>2)) + ## Update caterpillar plot with extreme levels highlighted + ## (highlight all groups with *either* extreme intercept *or* + ## extreme slope) + ggplot(aa3, aes(estimate,level,xmin=lb,xmax=ub,colour=factor(keep)))+ geom_errorbarh(height=0)+ geom_vline(xintercept=0,lty=2)+ geom_point()+facet_wrap(~variable,scale="free_x")+ diff --git a/tests/testthat/test-lme4.R b/tests/testthat/test-lme4.R index 0aeb35e..f8a639a 100644 --- a/tests/testthat/test-lme4.R +++ b/tests/testthat/test-lme4.R @@ -203,3 +203,4 @@ if (require(lmerTest, quietly = TRUE)) { }) detach("package:lmerTest") } +