One of the causes of this error is an outdated version of the main package R. For example, in Ubuntu, this happens if the r-base package is installed from the universe repository.
The fix is ββto add a CRAN repository and install R:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9 sudo add-apt-repository 'deb [arch=amd64,i386] https://cran.rstudio.com/bin/linux/ubuntu xenial/' sudo apt-get update sudo apt-get install r-base
source share