Explore Courses Blog Tutorials Interview Questions
0 votes
in R Programming by (7.3k points)

The install.packages() function in R is the automatic unzipping utility that gets and install packages in R.

1. How do I find out what directory R has chosen to store packages?

2. How can I change the directory in which R stores and accesses packages?

1 Answer

0 votes

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.

Related questions

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
asked Oct 17, 2019 in Java by Anvi (10.2k points)

Browse Categories