I am calculating descriptive statistics for my dataset, using R, wich I am not very familiar to. My dataset comprises of categorical variables and I would like to create bar charts with the counts of each value's frequencies. I was trying to use a for loop to create all the frequency plots concurrently ( 'multi.hist' does not apply in my case, since it requires a numeric matrix, I tried to use it but it resulyed to an error: 'x' must be numeric ).
I am trying to built a loop in which a ggplot plot will be created for every variable/column. I have been using the following code:
library(ggplot2)
for (x in c(1:ncol(mydata.f))) {ggplot(data.frame(mydata.f$x), aes(x=mydata.f$x)) + geom_bar()
}
Instead of the plots, when I ran the code nothing happens.