You can try to subset your dataframe directly in ggplot2
by using subset
:
library(ggplot2)
ggplot(data = subset(df, Day_Week == "Monday"), aes(x = total_price_diff_from_lowest))+
geom_histogram()
Is it what you are looking for ?
If not, please consider providing a reproducible example of your dataset by following this guide: How to make a great R reproducible example and to clarify what kind of plot you are looking for.
NB: ggplot2
is a package for making all kind of plot (see: https://ggplot2.tidyverse.org/) but it is not installed by default in R, so you will have to install it using install.packages("ggplot2")
. If you are looking for a solution using base r plot
, please see @RonakShah's answer.