If you are seeing exactly the same error message as above:
Warning in install.packages :
unable to access index for repository https://cloud.r-project.org/src/contrib:
cannot open URL 'https://cloud.r-project.org/src/contrib/PACKAGES'
then the problem is also with your connection to the internet. As @cderv said, you need to check that you can access the internet from your computing environment and see if you are behind any proxies or firewalls that may be preventing R from accessing the CRAN repository URLs.
If you are getting a different error message then you most likely have a different problem. In that case, please post a new topic including the exact code you ran and the exact error messages you received. Be sure to read our community guidelines for proper code formatting. Please don't post screenshots of code or error messages (as was done above) — they are difficult to read and not searchable.