You are totally right, R doesn't like empty spaces on Windows user names. Try installing into the system-wide package library instead (You need to run RStudio as Administrator for this to work)
# Modify the path accordingly with your own R version
install.packages("ggplot2", lib = "C:\\Program Files\\R\\R-3.6.3\\library")