I ran my data analysis and created my graphs in RStudio, but RStudio is just a platform for R. In my paper should I cite R or RStudio?
RStudio is an IDE for R — essentially an editor and debugger packed together. Your work is made possible by statisticians who developed the language R and graphical packages for it. If you want to cite R in your publication, here is the explanation how to do it.
Google Scholar is probably not doing a great job of tracking these software citations compared to journal articles that fit standard citation formatting better, but RStudio has ~1,800 citations whereas R has over 100,000 using the most common citation aggregate for each.
Many people cite neither and instead cite particular packages that they use, but by far it is more common to cite R which includes all of the base libraries, etc. RStudio is only an IDE, and although it could be useful and you are free to cite it as having been helpful in your development, anyone can take your R code written with the help of RStudio and run it with only R and get the same result.
Cite what you use. RStudio has a collection of developers who have made your work possible. Cite them. R is a language so it is, perhaps, less important to cite it. But if it has features that are important to your work, cite it. If you had used Python to do data analysis it might not be necessary to name it if there was nothing special about Python, but R is specialized for statistics so more likely that it should be cited.
Cite what you use. It is a courtesy to those who enable your work if nothing else. Citing RStudio