Combine categories of gender due to case sensitivity?

I thought I had cleaned the .csv prior to importing so that I wouldn't have this issue but, here I am. Is there a way for me to combine these differently formatted "female" and "male" categories so that there is just one, "Female" total and one "Male" total? (see below)

image

df$Gender <- tolower(df$Gender)

Thank you. I should have mentioned that I have many other variables in the data frame, not just Gender. Is there a way to isolate the command to just the "Gender" variable?

I believe my suggestion does exactly that.

I see, I just re-wrote it. Apologies but, can you then tell me how to merge it back into the original df? It created a new "value" rather than modify the value directly in the existing df.

Fixed it :slight_smile: Thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.