Frequency distribution in R
I have five columns with numbers. I want to plot the frequency distribution of five columns in one graph with different colors in R. Can some one help me out how i can do this with an example. I am very new to R. Using the sample data from @eddi, you can also consider the "lattice" package: set.seed(1) d <- data.frame(a = rnorm(100), b = rnorm(100, 1), c = rnorm(100, 2), d = rnorm(100, 3), e = rnorm(100, 4)) library(lattice) densityplot(~ a + b + c + d + e, data = d) This will yield: If you have many columns, you can also create your plot by first creating a formula : myFormula <- as.formula