I have got a fold-change dataset and I simply would like to plot something like this:
The problem is that I have only numbers in my columns and when I use a boxplot() function I can plot only boxes but not dots, jitter, etc.
I use this code to build a df and then proceed to a boxplot
A <- c(-1, 25, 3, 4, 50)
B <- c(23, -41, 32, 68, 26)
C <- c(63, 71, 22, -8, 2)
D <- c(16, -49, 2, 56, 6)
df <- data.frame(A, B, C, D)
print (df)
boxplot(df)
How can I plot something that looks like the above picture? Thanks
ggplot2
, specifically thegeom_boxplot
andgeom_dotplot
functions. Check out the cheat sheet (warning: PDF download) to see the full functionality of the package. $\endgroup$geom
data - if you check the dataset I have proposed - there is no"y"
data, I have only 4 columns (A,B,C,D) and rows with numbers. It is ok for default boxplot() while I cannot add geom, can you specify what should the ggplot2 script look like for the above-mentioned dataset? Thanks $\endgroup$