From 98ff131680806671bbbb75bed5195e0fccc9e318 Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Wed, 29 Aug 2018 16:39:28 +0200 Subject: [PATCH] support for older versions of ggplot2 --- R/ggplot_rsi.R | 12 +++++++----- man/ggplot_rsi.Rd | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/R/ggplot_rsi.R b/R/ggplot_rsi.R index 6ba39907..1c35b6e6 100644 --- a/R/ggplot_rsi.R +++ b/R/ggplot_rsi.R @@ -66,11 +66,6 @@ #' select(amox, nitr, fosf, trim, cipr) %>% #' ggplot_rsi() #' -#' # for colourblind mode, use divergent colours from the viridis package: -#' septic_patients %>% -#' select(amox, nitr, fosf, trim, cipr) %>% -#' ggplot_rsi() + scale_fill_viridis_d() -#' #' # get counts instead of percentages: #' septic_patients %>% #' select(amox, nitr, fosf, trim, cipr) %>% @@ -85,6 +80,13 @@ #' linetype = 2, #' alpha = 0.25) #' \donttest{ +#' +#' # for colourblind mode, use divergent colours from the viridis package: +#' septic_patients %>% +#' select(amox, nitr, fosf, trim, cipr) %>% +#' ggplot_rsi() + scale_fill_viridis_d() +#' +#' #' # it also supports groups (don't forget to use the group on `x` or `facet`): #' septic_patients %>% #' select(hospital_id, amox, nitr, fosf, trim, cipr) %>% diff --git a/man/ggplot_rsi.Rd b/man/ggplot_rsi.Rd index cc4eac9c..4ae1bf75 100644 --- a/man/ggplot_rsi.Rd +++ b/man/ggplot_rsi.Rd @@ -85,11 +85,6 @@ septic_patients \%>\% select(amox, nitr, fosf, trim, cipr) \%>\% ggplot_rsi() -# for colourblind mode, use divergent colours from the viridis package: -septic_patients \%>\% - select(amox, nitr, fosf, trim, cipr) \%>\% - ggplot_rsi() + scale_fill_viridis_d() - # get counts instead of percentages: septic_patients \%>\% select(amox, nitr, fosf, trim, cipr) \%>\% @@ -104,6 +99,13 @@ septic_patients \%>\% linetype = 2, alpha = 0.25) \donttest{ + +# for colourblind mode, use divergent colours from the viridis package: +septic_patients \%>\% + select(amox, nitr, fosf, trim, cipr) \%>\% + ggplot_rsi() + scale_fill_viridis_d() + + # it also supports groups (don't forget to use the group on `x` or `facet`): septic_patients \%>\% select(hospital_id, amox, nitr, fosf, trim, cipr) \%>\%