You can use the .libPaths() to print the default directory of package installation.
For instance:
> .libPaths()
[1] "C:/Users/intellipaat/Documents/R/R-3.6.0/library"
You can change the directory from default as follows:
.libPaths("C:/Users/intellipaat/Rpackages/ )
This creates a Rpackages folder to store packages that will be installed afterward.