I have a df such as
a b sex
yes yes male
no yes female
yes no male
I would like to count and store as an object only the count of males in the sex column.
I am running this:
n_male <- length(grep('male', tbl1_df[ ,"sex"]))
n_male
Because 'male' is in 'female', however, I am getting n_male = 3. How can I change this function to make it n_male = 2?