4

I am trying to run an R code in Ubuntu 16.04 LTS for sending SMS via Plivo, in my script I am using a library

#!/usr/bin/env Rscript
 library(httr) 
 code ....

After running this I get the error below

Error in library(httr) : there is no package called ‘httr’
Execution halted

Can anyone please help me?

Zanna
  • 70,465
zesan
  • 69

1 Answers1

4

You need to run your R session and then install httr package into it:

install.packages("httr")

then you can use this library.

Some R packages may need some development libraries (check messages during package compilation for the hints). In this particular case we need the following:

sudo apt-get install r-base-core libssl-dev libcurl4-openssl-dev

Note: on modern Ubuntu 18.04 LTS and 18.10 the httr is packaged as r-cran-httr.

N0rbert
  • 99,918