I am trying to plot a box plot for all the columns in a data frame. I can achieve it through R's native boxplot function.
boxplot(sam_som_2, use.cols = TRUE, xlab = "Samples", ylab = "Frequency", outline=FALSE)`
But I am not able to achieve the same with ggplot2
. It's throwing me one or the other errors.
Below is the plot that I want to plot using ggplot2
.
Here is a portion of my dataframe.
dput(my_data)
structure(list(`1` = c(875L, 1102L, 1028L, 925L), `2` = c(845L,
1065L, 1052L, 925L), `3` = c(840L, 1131L, 1080L, 953L), `4` = c(1006L,
1211L, 1120L, 556L), `5` = c(965L, 1271L, 1061L, 663L), `6` = c(995L,
1245L, 1125L, 395L), `7` = c(1026L, 1244L, 1109L, 607L), `8` = c(1087L,
1220L, 1068L, 601L)), .Names = c("1", "2", "3", "4", "5", "6",
"7", "8"), class = "data.frame", row.names = c(NA, -4L))