1

I have a factor called all_factors. I want to get the percentages of the different levels in that factor.

For example, let's say all_factors has the levels: "a", "b", "c". So I would want something that would tell me 30% of the levels are "a", 20% are "b", and 50% are "c".

Ezra Bekele
  • 143
  • 1
  • 2
  • 8

1 Answers1

1

Try table(all_factors)/sum(table(all_factors)).

Alex
  • 222
  • 1
  • 9