At which part of the paper is it better to cite R packages?
You should cite the software packages that you use just like any other piece of scientific work that you build on. If they are significant enough to make it to your main narrative, then cite them there just like the other key techniques you build upon. If they are useful but uninteresting methodological detail (e.g., equivalent to a microscope model or reagent brand) then they should  in just the same way be relegated to an equivalent methods section, appendix, or other piece of supplemental material.