Check out example codes for "error installing devtools r". It will help you in understanding the concepts better.

Code Example 1

ERROR: dependency ‘httr’ is not available for package ‘pkgdown’
* removing ‘/usr/local/lib/R/site-library/pkgdown’
ERROR: dependencies ‘usethis’, ‘covr’, ‘httr’, ‘rversions’ are not available for package ‘devtools’
* removing ‘/usr/local/lib/R/site-library/devtools’

# Solution
sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev

Learn ReactJs, React Native from akashmittal.com