diff --git a/01-software-modeling.Rmd b/01-software-modeling.Rmd index b2ba2c26..4e59114b 100644 --- a/01-software-modeling.Rmd +++ b/01-software-modeling.Rmd @@ -65,7 +65,7 @@ For example, large scale measurements of RNA have been possible for some time us An early method for evaluating such issues were probe-level models, or PLMs [@bolstad2004]. A statistical model would be created that accounted for the known differences in the data, such as the chip, the RNA sequence, the type of sequence, and so on. If there were other, unknown factors in the data, these effects would be captured in the model residuals. When the residuals were plotted by their location on the chip, a good quality chip would show no patterns. When a problem did occur, some sort of spatial pattern would be discernible. Often the type of pattern would suggest the underlying issue (e.g., a fingerprint) and a possible solution (wipe off the chip and rescan, repeat the sample, etc.). Figure \@ref(fig:software-descr-examples)(a) shows an application of this method for two microarrays taken from @Gentleman2005. The images show two different color values; areas that are darker are where the signal intensity was larger than the model expects while the lighter color shows lower than expected values. The left-hand panel demonstrates a fairly random pattern while the right-hand panel exhibits an undesirable artifact in the middle of the chip. -```{r software-descr-examples, echo = FALSE, fig.cap = "Two examples of how descriptive models can be used to illustrate specific patterns", out.width = '80%', dev = "png", fig.height = 8, warning = FALSE, message = FALSE} +```{r software-descr-examples, echo = FALSE, fig.cap = "Two examples of how descriptive models can be used to illustrate specific patterns", out.width = '80%', fig.height = 8, warning = FALSE, message = FALSE} load("RData/plm_resids.RData") resid_cols <- RColorBrewer::brewer.pal(8, "Set1")[1:2] diff --git a/16-dimensionality-reduction.Rmd b/16-dimensionality-reduction.Rmd index a0b56822..369b4185 100644 --- a/16-dimensionality-reduction.Rmd +++ b/16-dimensionality-reduction.Rmd @@ -317,7 +317,6 @@ bean_rec_trained %>% ``` ```{r bean-pca, ref.label = "dimensionality-pca"} -#| dev = "png", #| echo = FALSE, #| fig.height = 7, #| fig.cap = "First two principal component scores for the bean validation set, colored by class", @@ -360,7 +359,6 @@ bean_rec_trained %>% ``` ```{r bean-pls, ref.label = "dimensionality-pls"} -#| dev = "png", #| fig.height = 7, #| echo = FALSE, #| fig.cap = "First two PLS component scores for the bean validation set, colored by class", @@ -398,7 +396,6 @@ bean_rec_trained %>% ``` ```{r bean-ica, ref.label = "dimensionality-ica"} -#| dev = "png", #| echo = FALSE, #| fig.height = 7, #| fig.cap = "First two ICA component scores for the bean validation set, colored by class", @@ -436,7 +433,6 @@ bean_rec_trained %>% ```{r bean-umap} #| echo = FALSE, -#| dev = "png", #| fig.height = 5, #| fig.width = 10.1, #| fig.cap = "The first two UMAP component scores for the bean validation set, colored by class. Results are shown for supervised and unsupervised versions.", diff --git a/DESCRIPTION b/DESCRIPTION index 6d46c33e..e55a66a5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -62,6 +62,7 @@ Imports: probably, pscl, purrr, + ragg, ranger, recipes (>= 0.1.16), rlang, @@ -88,7 +89,6 @@ Imports: xgboost, yardstick Remotes: - tidymodels/censored, tidymodels/learntidymodels biocViews: mixOmics Encoding: UTF-8 diff --git a/_common.R b/_common.R index bf074b6e..7d6a2db6 100644 --- a/_common.R +++ b/_common.R @@ -3,11 +3,17 @@ options(dplyr.print_min = 6, dplyr.print_max = 6) options(cli.width = 85) options(crayon.enabled = FALSE) +library(ragg) + knitr::opts_chunk$set( comment = "#>", collapse = TRUE, fig.align = 'center', - tidy = FALSE + tidy = FALSE, + # see https://www.tidyverse.org/blog/2020/08/taking-control-of-plot-scaling/#the-solution + dev = "agg_png", + dev.args = list(res = 300, units = "in"), + fig.ext = "png" ) diff --git a/extras/ames.png b/extras/ames.png index 81af1723..25efc8b3 100644 Binary files a/extras/ames.png and b/extras/ames.png differ diff --git a/extras/ames_chull.png b/extras/ames_chull.png index 22f3ae9b..16c05f7e 100644 Binary files a/extras/ames_chull.png and b/extras/ames_chull.png differ diff --git a/extras/ames_plain.png b/extras/ames_plain.png index bf6ab32a..5c085c0f 100644 Binary files a/extras/ames_plain.png and b/extras/ames_plain.png differ diff --git a/extras/ames_sf.R b/extras/ames_sf.R index f9fc8925..503740e5 100644 --- a/extras/ames_sf.R +++ b/extras/ames_sf.R @@ -120,8 +120,7 @@ plain_ames <- ggplot() + xlim(ames_x) + ylim(ames_y) + - theme_vo -