Try in terminal: sudo apt-get install libssl-dev and after that try to install package openssl in R again.