Hey guys I hope someone can help me out. I want to make a loop that gives me an overlapping density plot. I have tried the following...
for (i in length(df)) {
x <- df[,i]
plot(density(x))
lines(density(x ))
}
However, this only gives me a plot with one density line. But in my case it should be 100 density lines overlapping in one plot.