So I've got a dataset that looks something like this:
a b c
23 34 Falcons
14 9 Hawks
2 18 Eagles
3 21 Eagles
22 8 Falcons
11 4 Hawks
And I know I can do a random subset of rows with a nested conditional, but what I want to do is create a random subset that takes at least one of each available value in column 'c'.
So possible correct subsets would be
23 34 Falcons
14 9 Hawks
3 21 Eagles
or
11 4 Hawks
2 18 Eagles
22 8 Falcons
[in no particular order], but something like:
14 9 Hawks
2 18 Eagles
3 21 Eagles
would NOT work, because 'Falcons' is not represented. Is there an easy way to do this in R?