Skip to content

Commit

Permalink
FT: #59 switch to "class()" for assigning class
Browse files Browse the repository at this point in the history
  • Loading branch information
ricfog committed Mar 31, 2021
1 parent fcd7133 commit 2574837
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 7 deletions.
7 changes: 4 additions & 3 deletions R/maars-lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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
)
Expand Down Expand Up @@ -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"))
}

Expand Down Expand Up @@ -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)
}

Expand Down
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/articles/se-la-county-data_files/figure-html/compare_lm-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions docs/pkgdown.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
pandoc: '2.11'
pandoc: 2.11.4
pkgdown: 1.6.1
pkgdown_sha: ~
articles:
se-la-county-data: se-la-county-data.html
last_built: 2021-03-30T13:55Z
last_built: 2021-03-31T09:26Z
urls:
reference: https://shamindras.github.io/maars/reference
article: https://shamindras.github.io/maars/articles
Expand Down

0 comments on commit 2574837

Please sign in to comment.