I have a dataframe named "test" like this:
group v x
1 a 110 114
2 a 90 150
3 c 57 100
4 d 53 98
5 e 114 67
6 f 143 126
7 g 110 95
8 g 106 101
9 i 103 70
10 j 149 73
I also have a dataframe of unique group values called "hold_df"
groups
1 a
2 c
3 d
4 e
5 f
6 g
7 i
8 j
I want to add columns to hold_df that include the count of unique occurences in the test dataframe, and the number of unique occurences when column v is over a certain threshold (e.g. 100)
groups unique uniqueConditional
1 a 2 1
2 c 1 0
3 d 1 0
4 e 1 1
5 f 1 1
6 g 2 2
7 i 1 1
8 j 1 1