I would like to be able to add values of a select element to a boxplot.
Example:
library(tidyr)
library(dplyr)
library(ggplot2)
iris$referenceNum = seq(1,length(iris$Species))
iris_Edit = iris %>%
pivot_longer(1:4)
p1 <- ggplot(iris_Edit) +
geom_boxplot(aes(y=value, fill=name)) +
facet_wrap(~name,scales="free")
p1
I would like to add the values to a select reference reference number.
Example say you want to add values for the element for reference number "4". Then the values 4.6 would be added to Petal.Length chart, 3.1 to Sepal.Width chart, 1.5 to Petal.Length chart, and 0.2 to Petal.Width chart.
iris_Edit_F = iris_Edit %>%
filter(referenceNum == 4)
iris_Edit_F
How would I go about adding those points to the plot?
