From 257483730552ebf8bed41e4c427491b395954bf5 Mon Sep 17 00:00:00 2001 From: ricfog <31448214+ricfog@users.noreply.github.com> Date: Wed, 31 Mar 2021 11:27:01 +0200 Subject: [PATCH] FT: #59 switch to "class()" for assigning class --- R/maars-lm.R | 7 ++++--- docs/CONTRIBUTING.html | 4 ++-- .../figure-html/compare_confint-1.png | Bin 102391 -> 101532 bytes .../figure-html/compare_lm-1.png | Bin 178363 -> 177453 bytes .../visualize_boot_estimates-1.png | Bin 111835 -> 111056 bytes docs/pkgdown.yml | 4 ++-- 6 files changed, 8 insertions(+), 7 deletions(-) diff --git a/R/maars-lm.R b/R/maars-lm.R index 58102668..d1f3ed7d 100644 --- a/R/maars-lm.R +++ b/R/maars-lm.R @@ -86,7 +86,7 @@ comp_var <- function(mod_fit, out_var <- comp_mms_var(mod_fit, boot_emp, boot_res, boot_mul) mod_fit[["var"]] <- out_var - attr(mod_fit, "class") <- c("maars_lm", "lm") + class(mod_fit) <- c("maars_lm", "lm") return(mod_fit) } @@ -319,6 +319,7 @@ summary.maars_lm <- function(object, all_summaries = all_summaries, all_emoji_titles = all_emoji_titles, all_assumptions = all_assumptions, + stats_lm = stats_lm, stats_sand = stats_sand, digits = digits ) @@ -353,7 +354,7 @@ print.summary.maars_lm <- function(x, ...) { ) cli::cli_h2(cli::col_blue(glue::glue("Signif. codes:"))) cli::cli_li("0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1") - cli::cli_h2(cli::col_magenta(glue::glue("Summary statistics:"))) + cli::cli_h2(cli::col_magenta(glue::glue("Summary statistics (sandwich):"))) cli::cli_li(purrr::pluck(x, "stats_sand")) } @@ -476,7 +477,7 @@ print.maars_lm <- function(x, ...) { #' #' @export as.maars <- function(x, ...) { - attr(x, "class") <- c("maars_lm", "lm") + class(x) <- c("maars_lm", "lm") return(x) } diff --git a/docs/CONTRIBUTING.html b/docs/CONTRIBUTING.html index dec73484..99b0a6ac 100644 --- a/docs/CONTRIBUTING.html +++ b/docs/CONTRIBUTING.html @@ -164,8 +164,8 @@
Fork the package and clone onto your computer. If you haven’t done this before, we recommend using usethis::create_from_github("shamindras/maars", fork = TRUE)
.
Install all development dependences with devtools::install_dev_deps()
, and then make sure the package passes R CMD check by running devtools::check()
. If R CMD check doesn’t pass cleanly, it’s a good idea to ask for help before continuing.
Create a Git branch for your pull request (PR). We recommend using usethis::pr_init("brief-description-of-change")
.
Make your changes, commit to git, and then create a PR by running usethis::pr_push()
, and following the prompts in your browser. The title of your PR should briefly describe the change. The body of your PR should contain Fixes #issue-number
.
Create a Git branch for your pull request (PR). We recommend using usethis::pr_init("brief-description-of-change")
.
Make your changes, commit to git, and then create a PR by running usethis::pr_push()
, and following the prompts in your browser. The title of your PR should briefly describe the change. The body of your PR should contain Fixes #issue-number
.
For user-facing changes, add a bullet to the top of NEWS.md
(i.e. just below the first header). Follow the style described in https://style.tidyverse.org/news.html.
9y_z1vkq$c
z?c{sWi38XENP~p!#TkPi#MH_g#_;)S(GUGUTHgsKS|F+?2=lKtxgmZ<`1s~{z0cJg
zMJ|WG^-gmwR0!+6?Tb^dMDXG|sN*_td)$&bpX1LcP%qYLcVoV>i&am!hmnbLA{cqrr&SS~@S
znMVG!((24!2Q0eu6IOA{6!8g@?hbV6WWtSWY5UB7YVJ2NSFL{j{(7)7H&d@jA=YZg
zvyIzxcdq!2?U?Z
v@=2H0
z@q-wHql#%2Zsdv5?`hg$<6lw>{nQ_F1C#bWdJdzh^e*0J1&@SMw17q0yvKAEW{DJP
zJGik}2ozx357_~$IE$->K4m~LhSUL47=DO=U|i8oDVln%bkREBNMi5F1hJXf&hY+m
za6E~b*+Kl@i{p7oF)R%zGJzyC1E6LI5pIO{cv$(Ij-DO~f(pgqG6G5yAIZ$mSAb#B
zzmU)OYdzhnUN^xzb4|kGcTg%p+V@}OU*VC%LIec`vllg}@s58>jcbn6{!0sR3@NpK
zFtR%EV?XqPpta#|Eb|s84NpAK`mzkr^Zu)@xPdCR{OXd-L5{Zg)>Q34qpch
z6-3>mHy_qPTMq`#sEjd7f|e1z0CZ3ZgJ@)#>by{20GYa##M^gQxVeGBi4Xg|zQ>B7
z+nsXG5HwW{ov^@AAB{!RPk8w3Gh@U=_o
{xd#t
z2!pMJ85n9%^E5!!6bMwp6lej~D#$3ak~3zpy7OzO4gFSVt_sB-mbv%TH)GJH|AB*%
zklV_*ih!C7ZHfwVC}?cIh&F^5OU
zE!n4mYfu`|!n~*Pt!w5hj0!(hMO}Cl5%