[R] ggplot2: multiple box plots, different tibbles/dataframes

Jeff Newmiller jdnewm|| @end|ng |rom dcn@d@v|@@c@@u@
Thu Nov 11 17:08:30 CET 2021


I strongly recommend that you change your way of thinking when it comes to ggplot: if your data are not yet in one data frame then your data are not yet ready for plotting.

It is possible to specify separate data frames for different layers of the plot, but this severely complicates building legends.

On November 11, 2021 7:46:15 AM PST, Rich Shepard <rshepard using appl-ecosys.com> wrote:
>On Thu, 11 Nov 2021, Bill Dunlap wrote:
>
>> I googled for "ggplot2 boxplots by group" and the first hit was
>>  https://www.r-graph-gallery.com/265-grouped-boxplot-with-ggplot2.html
>> which displays lots of variants along with the code to produce them.  It
>> has links to ungrouped boxplots and shows how violin plots can better
>> display your data.
>
>Bill,
>
>As I thought, all the returned pages use multiple groups within the same
>dataframe. I'm still looking to learn how to pass multiple dataframes to one
>ggplot() function, each with its own aesthetics.
>
>Regards,
>
>Rich
>
>______________________________________________
>R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.

-- 
Sent from my phone. Please excuse my brevity.



More information about the R-help mailing list