From R run this:
source("https://pak.r-pkg.org")
From the shell run this:
curl https://pak.r-pkg.org | sh -