Check out example codes for "how to make an r package that install its dependencies". It will help you in understanding the concepts better.

Code Example 1

install.packages("mypackage.tar.gz",type="source",dependencies=TRUE,repos="http://a.cran.mirror")

Learn ReactJs, React Native from akashmittal.com