My Coding > Software > R > Installing R library

Installing R library

Every time you run R, the first line should be loading necessary libraries: library(dplyr). If this command cause an error

> library(dplyr)
Error in library(dplyr) : there is no package called ‘dplyr’

Its mean that it is necessary to install this library.

Installing library for R

The easiest way is to use command install.packages("LIBRARY_NAME")

> library(calendR)
Error in library(calendR) : there is no package called ‘calendR’
> install.packages("calendR")
Installing package into ‘/home/luxs/R/x86_64-pc-linux-gnu-library/3.2’
(as ‘lib’ is unspecified)
. . . 

and at the end of this output you should receive an information about successful installation of this library

* DONE (CalendR)

or you can receive message about faulty installation process

Warning messages:
1: In install.packages("calendR") :
  installation of package ‘ellipsis’ had non-zero exit status

If you library installed successfully, then it is possible to use it.

Install few libraries at once

It is possible to install few libraries in one command, by giving them coma separates

install.packages(c("ggplot2", "dplyr"))

Published: 2021-11-17 01:12:20
Updated: 2021-11-17 01:15:49

Last 10 artitles

9 popular artitles

© 2020 -My blog about coding and further learning. This blog was writen with pure Perl and front-end output was performed with TemplateToolkit.