How to use Rstudio to edit excel

Yes, you have to, RStudio is not a statistical software like SPSS, Minitab, etc, it is an IDE (Integrated Development Environment) for the R programming language, so it doesn't implement any functionality by its own, you have to use R packages (like ggplot2) for that.

Which package to use is going to depend on what exactly you are trying to accomplish, "edit excel instead of working on Excel itself" is a very vague statement, so could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

If you've never heard of a reprex before, you might want to start by reading this FAQ: