Code:
f<-data %>%
count(city_name, gender_full== "Male", sort = TRUE) %>%
slice_head(n = 10)
colnames(f)=c("city", "Number of male")
f
Output :
city Number of male NA
1 Vancouver FALSE 5878
2 Vancouver TRUE 5333
3 Victoria FALSE 2572
4 Victoria TRUE 2313
5 Nanaimo TRUE 2006
6 Nanaimo FALSE 1870
7 New Westminster FALSE 1730
8 New Westminster TRUE 1481
9 Kelowna FALSE 1345
10 Kelowna TRUE 1168
In my output, at the column "Number of male" it has a mixture of "TRUE" and "FALSE". How can i change False to "Female" and True to "Male"?