Re: [R] ggplot2 Pareto plot (Barplot in decreasing frequency)

2010-10-06 Thread Dennis Murphy
Hi: # Generate a factor and a random set of counts/frequencies df <- data.frame(gp = LETTERS[1:20], frq = rpois(20, 30)) # bar plot in lexicographic order of factor levels ggplot(df, aes(x = gp)) + geom_bar(aes(y = frq), stat = 'identity') # bar plot in increasing order of frequency ggplot(df, aes

Re: [R] ggplot2 Pareto plot (Barplot in decreasing frequency)

2010-10-06 Thread David Winsemius
On Oct 6, 2010, at 5:19 PM, Morten wrote: Hi all I have a large dataframe with (among others) a categorical variable of 52 levels and would like to create a barplot with the bars ordered in decreasing frequency of the levels. I belive it is referred to as a pareto plot. Consider a subs

[R] ggplot2 Pareto plot (Barplot in decreasing frequency)

2010-10-06 Thread Morten
Hi all I have a large dataframe with (among others) a categorical variable of 52 levels and would like to create a barplot with the bars ordered in decreasing frequency of the levels. I belive it is referred to as a pareto plot. Consider a subset where I keep only the categorical variable in qu