Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test if less or equal is handled #50

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ggstats (development version)

**Bug fixes**

* fix in `ggcoef_model()` and other similar functions when Unicode character
'less or equal' is not handled by the system

# ggstats 0.5.0

**Improvements**
Expand Down
8 changes: 7 additions & 1 deletion R/ggcoef_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,13 @@

if (!is.null(significance)) {
if (is.null(significance_labels)) {
significance_labels <- paste(c("p \u2264", "p >"), significance)
# test if \u2264 could be safely used
test_unicode <- purrr::quietly(function() {plot(0, main = "\u2264")})

Check warning on line 1156 in R/ggcoef_model.R

View workflow job for this annotation

GitHub Actions / lint

file=R/ggcoef_model.R,line=1156,col=49,[brace_linter] Opening curly braces should never go on their own line and should always be followed by a new line.
if (length(test_unicode()$warnings) == 0) {
significance_labels <- paste(c("p \u2264", "p >"), significance)
} else {
significance_labels <- paste(c("p <=", "p >"), significance)
}
}
data$significance <- factor(
!is.na(data$p.value) & data$p.value <= significance,
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ mod1 <- lm(Fertility ~ ., data = swiss)
ggcoef_model(mod1)
```

<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-4-1.png" width="100%" /><img src="man/figures/README-unnamed-chunk-4-2.png" width="100%" />

``` r
ggcoef_table(mod1)
```

<img src="man/figures/README-unnamed-chunk-4-2.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-4-3.png" width="100%" /><img src="man/figures/README-unnamed-chunk-4-4.png" width="100%" />

## Comparing several models

Expand All @@ -69,7 +69,7 @@ models <- list(
ggcoef_compare(models, type = "faceted")
```

<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" />
<img src="man/figures/README-unnamed-chunk-5-1.png" width="100%" /><img src="man/figures/README-unnamed-chunk-5-2.png" width="100%" />

## Compute custom proportions

Expand Down
Binary file modified man/figures/README-unnamed-chunk-4-1.png
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 man/figures/README-unnamed-chunk-4-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-unnamed-chunk-4-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-unnamed-chunk-4-4.png
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 man/figures/README-unnamed-chunk-5-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/figures/README-unnamed-chunk-5-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading