From ebfa02166530b36e7a48077a62929be4610cec15 Mon Sep 17 00:00:00 2001 From: arranhamlet Date: Wed, 18 Sep 2024 14:14:13 -0700 Subject: [PATCH] Large scale updates to numerous chapters filling in issues raised on github --- html_outputs/new_pages/ggplot_tips.html | 13 +- .../figure-html/unnamed-chunk-23-1.png | Bin 28792 -> 28964 bytes .../figure-html/unnamed-chunk-24-1.png | Bin 55625 -> 55592 bytes .../figure-html/unnamed-chunk-28-1.png | Bin 70851 -> 69410 bytes html_outputs/search.json | 4 +- new_pages/basics.qmd | 9 +- new_pages/basics.rmarkdown | 1791 +++++++++++++++++ .../basics_files/execute-results/html.json | 17 + new_pages/dates.qmd | 32 + new_pages/errors.qmd | 2 +- new_pages/ggplot_basics.qmd | 5 - new_pages/ggplot_tips.qmd | 5 +- new_pages/regression.qmd | 67 +- new_pages/shiny_basics.qmd | 6 +- new_pages/standardization.qmd | 143 +- new_pages/stat_tests.qmd | 4 +- new_pages/survey_analysis.qmd | 38 + new_pages/writing_functions.qmd | 29 +- old_bookdown/new_pages/collaboration.Rmd | 6 +- old_bookdown/new_pages/heatmaps.Rmd | 9 +- 20 files changed, 1995 insertions(+), 185 deletions(-) create mode 100644 new_pages/basics.rmarkdown create mode 100644 new_pages/basics_files/execute-results/html.json diff --git a/html_outputs/new_pages/ggplot_tips.html b/html_outputs/new_pages/ggplot_tips.html index f97d62f4..54208990 100644 --- a/html_outputs/new_pages/ggplot_tips.html +++ b/html_outputs/new_pages/ggplot_tips.html @@ -848,8 +848,8 @@

Import data

The first 50 rows of the linelist are displayed below.

-
- +
+
@@ -1661,7 +1661,7 @@

This also works well with faceting functions - it allows the user to produce facet plots with the background data highlighted that doesn’t apply to the facet! Below we count cases by week and plot the epidemic curves by hospital (color = and facet_wrap() set to hospital column).

-
# produce a histogram of all cases by age
+
# produce a linegraph of all cases by age
 linelist %>% 
   count(week = lubridate::floor_date(date_hospitalisation, "week"),
         hospital) %>% 
@@ -1671,7 +1671,8 @@ 

color = hospital)) + theme_minimal() + gghighlight::gghighlight() + # highlight instances where the patient has died - facet_wrap(~hospital) # make facets by outcome

+ facet_wrap(~hospital) + # make facets by outcome + scale_x_date(labels = date_format("%m/%y"))
@@ -1860,7 +1861,7 @@

  • The epicurve and the line are aggregated into weeks prior to plotting and the date_breaks and date_labels are identical - we do this so that the x-axes of the two plots are the same when they are overlaid.
  • -
  • The y-axis is created to the right-side for plot 2 with the sex_axis = argument of scale_y_continuous().
  • +
  • The y-axis is created to the right-side for plot 2 with the sec_axis = argument of scale_y_continuous().
  • Note there is another example of this technique in the Epidemic curves page - overlaying cumulative incidence on top of the epicurve.

    Make the datasets for the plot
    @@ -2653,7 +2654,7 @@

    -