select()
filter()
group_by()
summarise()
dplyr
ggplot2
apply()
ifelse()
lapply()
sapply()
There are a lot of great resources available on programming in R and evolutionary genetics. There are also some good further tutorials on understanding HWE and drift in R too. Below is a collection of resources you might find of use.