In this lab, you will install the R package gapminder
.
The name of the package you will need to install for different labs may
change.
In this lab, you will learn the following:
Do the following steps:
Home
directory.R
and press the Return Key. This will start up R.install.packages("gapminder")
The following will be displayed:
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning in install.packages("gapminder") :
'lib = "/usr/local/lib/R/site-library"' is not writable
Would you like to use a personal library instead? (yes/No/cancel)
yes
.The following will be displayed:
Would you like to create a personal library
‘~/R/x86_64-pc-linux-gnu-library/4.1’
to install packages into? (yes/No/cancel)
yes
again.The following will be displayed:
trying URL 'https://cloud.r-project.org/src/contrib/gapminder_0.3.0.tar.gz'
Content type 'application/x-gzip' length 2110951 bytes (2.0 MB)
==================================================
downloaded 2.0 MB
* installing *source* package ‘gapminder’ ...
** package ‘gapminder’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** testing if installed package can be loaded from temporary location
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (gapminder)
This means that the package gapminder
is installed in
your project.
.libPaths()
Then something similar to the following will be displayed:
[1] "/home/user/R/x86_64-pc-linux-gnu-library/4.1"
[2] "/usr/local/lib/R/site-library"
[3] "/usr/lib/R/site-library"
[4] "/usr/lib/R/library"
>
Note: You can see that the library directory was created and appears in line [1].
Next time you install another package in your project’s
Home
directory, you will not need to create the library
because it has already been created (you will NOT run steps 5 and
6).