I am a beginner in R programming, and I struggle to find how to know the most represented country of a data set.
names = c("Andrew","Anna","Alice","Antony", "Barbara", "Brian","Boris","Barney", "Claudia","Cliff","Cecilia","Clara", "David","Dora","Denise","Donatello", "Emma","Elise","Esteban","Elon") ages = c(20,22,27,25,18,22,26,21,19,24, 27,23,22,19,23,28,22,24,25,19) heights = c(180,170,155,175,150,197,178,182,183,170, 175,178,170,160,175,194,180,165,172,183) nationalities = c("France","Scotland","Italy","Poland", "France","India","UK","Poland", "Italy","Scotland","UK","France", "Mexico","USA","France","Germany", "USA","France","Spain","Poland") gender = c(0,1,1,0,1,0,0,0,1,0,1,1,0,1,1,0,1,1,0,0) grades = c(16,18,19,18,15,14,15,18,17,20, 20,19,15,16,18,14,20,15,19,17) class = data.frame(names,ages,heights,nationalities, gender, grades)
I think I have to use table function but i don't know how to print the country that has the highest frequency. Thanks !