1

I have a column in my data that is split by poor, Average and Good. I'm looking to find the Max and the Min number in a different column when one of those categories is selected.

This is what I have for the code:

aggregate(as.numeric(data_gt$Category), list(exptCount=data_gt$Employment_Rate),max)

Is there an easier way to do this, even if it takes more commands to individually get the max min for each category?

Thanks for your help, I'm new to R so still learning the basics.

Joe
  • 62,789
  • 6
  • 49
  • 67
user2981599
  • 11
  • 1
  • 2

1 Answers1

1

You can get this error message if you specified incorrect variable name (data_gt$Category instead of data_gt$category).

Yevgen Yampolskiy
  • 7,022
  • 3
  • 26
  • 23