If you get the error:
C++14 standard requested but CXX14 is not defined
You need to create some environment variables that R can use to compile the code.
If it doesn't exist create the directory ~/.R by performing:
mkdir ~/.R
inside this directory create the text file Makevars.
In your preferred text editor add the following environment variables to ~/.R/Makevars
CXX14 = g++
CXX14FLAGS = -O3
CXX14FLAGS += -fPIC
After this restart R and the error should disappear.