strengejacke / sjstats

Effect size measures and significance tests
https://strengejacke.github.io/sjstats
189 stars 21 forks source link

warning with `rlang 0.3.0` #55

Closed IndrajeetPatil closed 5 years ago

IndrajeetPatil commented 5 years ago

I am getting the following rlang-related warning in my package checks and I traced it back to sjstats functions. This warning will turn into error from next release of rlang, so it'll be good to take care of it sooner than later. Thanks.

# setup
options(warn = 2)
library(sjstats)
#> Registered S3 methods overwritten by 'ggplot2':
#>   method         from 
#>   [.quosures     rlang
#>   c.quosures     rlang
#>   print.quosures rlang
set.seed(123)

# load sample data
data(efc)

# fit linear model
fit <- aov(
  c12hour ~ as.factor(e42dep) + as.factor(c172code) + c160age,
  data = efc
)

# partial omega-squared
sjstats::omega_sq(fit, partial = TRUE, ci.lvl = 0.95)
#> Error: (converted from warning) Prefixing `UQS()` with the rlang namespace is deprecated as of rlang 0.3.0.
#> Please use the non-prefixed form or `!!!` instead.
#> 
#>   # Bad:
#>   rlang::expr(mean(rlang::UQS(args)))
#> 
#>   # Ok:
#>   rlang::expr(mean(UQS(args)))
#> 
#>   # Good:
#>   rlang::expr(mean(!!!args))
#> 
#> This warning is displayed once per session.

Created on 2018-11-27 by the reprex package (v0.2.1)

strengejacke commented 5 years ago

I don't ise UQS anywhere in my code in sjstats?

strengejacke commented 5 years ago

And I can't find it in my other packages that sjstats imports...

strengejacke commented 5 years ago

Have you checked if this is something internal in the rlang-package?

IndrajeetPatil commented 5 years ago

You are right, this is not coming from sjstats, but from further upstream (broom). Sorry, should have run traceback() before. But this will affect your package as well. I'll open an issue on broom repo-

15: doWithOneRestart(return(expr), restart)
14: withOneRestart(expr, restarts[[1L]])
13: withRestarts({
        .Internal(.signalCondition(cond, message, call))
        .Internal(.dfltWarn(message, call))
    }, muffleWarning = function() NULL)
12: warning(warningCondition(msg, old = old, new = new, package = package, 
        class = "deprecatedWarning"))
11: .Deprecated(msg = x)
10: list2(...)
9: recode.character(colnames(ret), rlang::UQS(renamers))
8: dplyr::recode(colnames(ret), rlang::UQS(renamers))
7: tidy.anova(s[[1]])
6: tidy.aov(model)
5: broom::tidy(model)
4: as.data.frame(broom::tidy(model))
3: aov_stat_summary(model)
2: aov_stat(model, type = type)
1: sjstats::omega_sq(fit, partial = TRUE, ci.lvl = 0.95)
strengejacke commented 5 years ago

I'm afraid this will affect many packages, but as broom is part of the tidyverse, I'm sure this will be fixed in time.