Skip to content

Commit

Permalink
fixed patchwork suggests
Browse files Browse the repository at this point in the history
  • Loading branch information
rmk118 committed Oct 21, 2024
1 parent 45182cd commit 9073a61
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ RoxygenNote: 7.3.2
Suggests:
knitr,
rmarkdown,
patchwork,
testthat (>= 3.0.0)
Config/testthat/edition: 3
VignetteBuilder: knitr
30 changes: 21 additions & 9 deletions vignettes/classification.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ library(dplyr)
library(ggplot2)
library(tidyr)
library(purrr)
library(patchwork)
knitr::opts_chunk$set(message = FALSE)
```
Expand Down Expand Up @@ -109,14 +108,27 @@ fc_infl_pt <- fc %>% mutate(pred_mat = as.factor(if_else(y/x > disc, 1, 0)),
```

```{r}
(ggplot() +
geom_point(data = fc_infl_pt, aes(x, y, color = mature), alpha = 0.4) +
labs(x = "CW (mm)", y = "CH (mm)", title = "True maturity") +
mytheme) +
(ggplot() +
geom_point(data = fc_infl_pt, aes(x, y, color = pred_mat), alpha = 0.4) +
labs(x = "CW (mm)", y = "CH (mm)", title = "Predicted maturity") +
mytheme)
if (rlang::is_installed("patchwork")) {
(ggplot() +
geom_point(data = fc_infl_pt, aes(x, y, color = mature), alpha = 0.4) +
labs(x = "CW (mm)", y = "CH (mm)", title = "True maturity") +
mytheme) +
(ggplot() +
geom_point(data = fc_infl_pt, aes(x, y, color = pred_mat), alpha = 0.4) +
labs(x = "CW (mm)", y = "CH (mm)", title = "Predicted maturity") +
mytheme)
} else {
ggplot() +
geom_point(data = fc_infl_pt, aes(x, y, color = mature), alpha = 0.4) +
labs(x = "CW (mm)", y = "CH (mm)", title = "True maturity") +
mytheme
ggplot() +
geom_point(data = fc_infl_pt, aes(x, y, color = pred_mat), alpha = 0.4) +
labs(x = "CW (mm)", y = "CH (mm)", title = "Predicted maturity") +
mytheme
}
```

```{r}
Expand Down
6 changes: 5 additions & 1 deletion vignettes/two-line.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ stevens_est

# Two-line with logistic transition

# chngpt stegmented
```{r}
tll_est <- two_line_logistic(fc, "x", "y", verbose = FALSE)
tll_est
```



## References

0 comments on commit 9073a61

Please sign in to comment.