Linking genomics and population genetics with R