.rs.listIndexedPackages() is an RStudio internal function that is used to list all your installed packages.
Can you run in R console .libPaths() to let us know where are your library folder ?
In RStudio if possible, or directly in R console if RStudio is not working.
by any chance, did you try to reinstall R and RStudio ?
It could be something related to an issue during previous installation I guess.
Hope it helps.