'Installing DAAG library in R

What is wrong with the installation of DAAG package, please?

> install.packages("DAAG")

It gives an error:

Installing package into ‘/home/linux/R/x86_64-pc-linux-gnu-library/4.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘jpeg’, ‘latticeExtra’

trying URL 'https://cloud.r-project.org/src/contrib/jpeg_0.1-9.tar.gz'
Content type 'application/x-gzip' length 18596 bytes (18 KB)
==================================================
downloaded 18 KB

trying URL 'https://cloud.r-project.org/src/contrib/latticeExtra_0.6-29.tar.gz'
Content type 'application/x-gzip' length 1292315 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cloud.r-project.org/src/contrib/DAAG_1.24.tar.gz'
Content type 'application/x-gzip' length 1431281 bytes (1.4 MB)
==================================================
downloaded 1.4 MB

* installing *source* package ‘jpeg’ ...
** package ‘jpeg’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -std=gnu11 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-J7pprH/r-base-4.1.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c read.c -o read.o
In file included from read.c:1:0:
rjcommon.h:11:10: fatal error: jpeglib.h: Adresář nebo soubor neexistuje
 #include <jpeglib.h>
          ^~~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:168: recipe for target 'read.o' failed
make: *** [read.o] Error 1
ERROR: compilation failed for package ‘jpeg’
* removing ‘/home/linux/R/x86_64-pc-linux-gnu-library/4.1/jpeg’
Warning in install.packages :
  installation of package ‘jpeg’ had non-zero exit status
ERROR: dependency ‘jpeg’ is not available for package ‘latticeExtra’
* removing ‘/home/linux/R/x86_64-pc-linux-gnu-library/4.1/latticeExtra’
Warning in install.packages :
  installation of package ‘latticeExtra’ had non-zero exit status
ERROR: dependency ‘latticeExtra’ is not available for package ‘DAAG’
* removing ‘/home/linux/R/x86_64-pc-linux-gnu-library/4.1/DAAG’
Warning in install.packages :
  installation of package ‘DAAG’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/Rtmphv8qDd/downloaded_packages’

Packages are downloaded:

enter image description here

Why did compilation for package ‘jpeg’ fail, please? How to correct the problem? Many thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source