Method   I: install R package
////////////////////////////////

 We use command of install.packages("packageName")

 >install.packages("fImport")

  Installing package into  C:/Users/yany/Documents/R/win-library/3.3 
  (as  lib  is unspecified)
   --- Please select a CRAN mirror for use in this session ---

 [choose a mirror location]

  --- Please select a CRAN mirror for use in this session ---
  trying URL 'https://mirrors.nics.utk.edu/cran/bin/windows/contrib/3.3/fImport_3000.82.zip'
  Content type 'application/zip' length 442192 bytes (431 KB)
  downloaded 431 KB

  package  fImport  successfully unpacked and MD5 sums checked

  The downloaded binary packages are in
        C:\Users\yany\AppData\Local\Temp\RtmpSi40vh\downloaded_packages


 Type library(fImport) to see

  > library(fImport)
    Loading required package: timeDate
    Loading required package: timeSeries

///////////////////////////////

Method  II: install R package
////////////////////////////////

 Click "Packages" on the menu bar

 Click "Install Package(s) ... 

 Choose a mirror location 

 chose your package from a list 

///////////////////////////////

Method III: install R package
////////////////////////////////

 Step 1: manually download an R pakcage

 Step 2: Click "Packages" on the menu bar

         Click "Install Package(s) from local files... 

 Step 3: find the saved package and install 
         
///////////////////////////////

Is an R package loaded?
////////////////////////////////

  we use "package:PackageName" %in% search 

  Below, we use the R package called XML as an example

  > "package:XML" %in% search()
  
   [1] FALSE
  
///////////////////////////////

Is an R package preinstalled?
////////////////////////////////
we use command of 

    "packageName" %in% .packages(all.available=T)

 For example,

   "XML" %in% .packages(all.available=T)

     [1] TRUE

///////////////////////////////

PackageDescription() function 
////////////////////////////////
> packageDescription("fImport")

   Package: fImport
   Version: 3000.82
   Revision: 5455
   Date: 2013-03-15

  Title: Rmetrics - Economic and Financial Data Import
  Author: Diethelm Wuertz and many others
  Depends: R (>= 2.13.0), methods, timeDate, timeSeries
  Suggests: RUnit

  Maintainer: Yohan Chalabi <yohan.chalabi@rmetrics.org>

  Description: Environment for teaching "Financial Engineering and
               Computational Finance"
  Note: Several parts are still preliminary and may be changed in the
             future. this typically includes function and argument names, as
             well as defaults for arguments and return values.

   LazyData: yes

   License: GPL (>= 2)
   URL: http://www.rmetrics.org
   Packaged: 2013-03-15 12:46:58 UTC; yankee
   NeedsCompilation: no
   Repository: CRAN
   Date/Publication: 2013-03-15 14:54:11
   Built: R 3.3.3; ; 2017-11-08 18:42:38 UTC; windows

   -- File: C:/Users/yany/Documents/R/win-library/3.3/fImport/Meta/package.rds 
  
///////////////////////////////