Multiple mailboxes using ggplot

I have a data framework that looks like the one that is attached, with 6 columns and 1000 rows (tab split). The column headings (0.30, 60, 120, 240, and 360) are time series (from 0 to 0 minutes, 30 to 30 minutes, etc.). I would like to create 6 boxes corresponding to the columns using ggplot2 in the same plot, keeping in mind that they should be posted based on the time difference. It seems I will need to melt the columns, but I cannot figure out how to do this. Any help would be greatly appreciated.

0 30 60 120 240 360 1 1 NA NA NA 1 1 2 NA NA NA NA NA NA 3 NA NA 1 1 1 1 4 0.5 0.21 0.15 1 0.38 0.8 5 0.63 1 0.86 0.85 0.94 0.91 
+4
source share
1 answer

Did you try to just use the melt?

 library(reshape2) ggplot(melt(df), aes(variable, value)) + geom_boxplot() 

enter image description here

+6
source

Source: https://habr.com/ru/post/1498072/


All Articles