Check out example codes for "r install package". It will help you in understanding the concepts better.

Code Example 1

# Basic syntax:

# To then use the package in R, you need to run:
# Note, when you install a package, the package name has to be in quotes
#	but when you load it, it shouldn't be

# If your package isn't in the main CRAN repositry (which is rare), use:
install.packages("package_you_want", "")
# Where there other repo URL is the base URL of the other repository

Learn ReactJs, React Native from