Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 202065

Plotting distribution of all columns for 2 different factors using ggplot?

$
0
0

I have a data frame that can be generated as follows:

DD <- data.frame(group = c(rep("A", 5), rep("B", 6)), Feat1 = rnorm(11), feat2 = rnorm(11,3,5), feat3 = rnorm(11), feat4 = rnorm(11,2,3))

I would like to plot the distribution of each column feature for 2 factors(A & B) of the column called group. i.e. I would like to have 4 plots for columns feat1, feat2,... where each one has 2 distribution plots of group A and B. I would like to have 4 plot in one frame at once.

Do you have any idea how can I do it using ggplot?


Viewing all articles
Browse latest Browse all 202065

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>