[R] ggplot2: multiple box plots, different tibbles/dataframes
r@hep@rd @end|ng |rom @pp|-eco@y@@com
Thu Nov 11 19:24:34 CET 2021
On Thu, 11 Nov 2021, Avi Gross via R-help wrote:
> Say I have a data.frame with columns called PLACE and MEASURE others. The
> one I call PLACE would be a factor containing the locations you are
> measuring at. I mean it would be character strings of your N places but
> the factors would be made in the order you want the results in. The
> MEASURE variable in each row would contain one of the many measures at
> that location. You probably would have other columns like DATE.
Here are the head and tail of one data file:
(Water years begin October 1st and end September 30th.)
The other three locations have the same format.
The boxplots for each PLACE (site_nbr) should summarize all MEASURE (cfs)
values for all recorded data (DATE).
The R tibbles have a datetime column which could be the DATE.
If I assemble all 4 sites into a single tupple I suppose it would have three
columns PLACE (the grouping factor), DATE (on the x axis), and MEASURE (cfs on
the y axis) and each boxplot would be grouped so the
command would be:
disc_plot <- ggplot(df, aes(x = group, y = cfs)) +
Is this close?
More information about the R-help