0

are there any ways to categorised the same frequency as others because I'm having 100 data in x. This will need to be done with ggplot.

library('ggplot2')

test <- ggplot(data =albums_df,aes(x=People)) + stat_count(width = 0.5) +
  scale_y_continuous(breaks = seq(1, 10, 1)) + coord_flip() 
print(test)

My x is people and I want to name the same frequency as others to make my chart looks neater. Thank you

  • 2
    It would be easier to help you if you provide [a minimal reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) including a snippet of your data or some fake data. As is (1) we can't run your code, (2) it's not clear what's the issue and (3) it's not clear what you want to achieve. – stefan Nov 05 '22 at 09:03
  • @stefan Basically I have a list of singer such as adam, adele and etc. I want to classified singer with just frequency of 1 as others. And how should I achieve this? – Mastery mind Nov 05 '22 at 09:08
  • 1
    See the`forcats::fct_lump` family of functions. – stefan Nov 05 '22 at 09:11

0 Answers0