one-line code for 10 finance formulas
////////////////////////////////

fv_f<-function(pv,r,n) pv*(1+r)^n
pv_f<-function(fv,r,n) fv/(1+r)^n

#
pv_perpetuity<-function(c,r) c/r	
pv_growing_perpetuity<-function(c,r,g=0) c/(r-g)	

#
pv_annuity<-function(c,r,n)c/r*(1-1/(1+r)^n)
pv_annuity_due<-function(c,r,n)c/r*(1-1/(1+r)^n)*(1+r)
fv_annuity<-function(c,r,n)c/r*((1+r)^n-1)
fv_annuity_due<-function(c,r,n)c/r*((1+r)^n-1)*(1+r)

#
pv_growing_annuity<-function(c,r,n)c/(r-g)*(1-(1+g)^n/(1+r)^n)
fv_growing_annuity<-function(c,r,n)c/(r-g)*((1+r)^n-(1+g)^n)

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

Draw a area
////////////////////////////
Assume that we have the following two columns.

x,10
y,20
z,40
a,30
b,10

  Step 1: high-light both columns
  Step 2: insert -> Area

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

.showFormula function 
////////////////////////////
  Type the function name to see its
     usage

   .showFormula

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

For (x,y) scatter, x is used as the horizontal axis 
                     while y is used as the vertical axis:
////////////////////////////

Assume that we have the following two columns. 
         where y= 3+3x
x       y
1       6
2       9
3       12
4       15
5       18
6       21
7       24
8       27
9       30
10      33
11      36

  Step 1: highlight both columns
  Step 2: Click "Insert" -> Line -> All chart types
  Step 3: choose "X Y (scatter"
  Step 4: click " OK"

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

Generate a moving GIF
////////////////////////////
  Type the following function name:

      .movingGIF

   Original code: Bhalla,Deepanshu,Create Animation In R:Learn By Examples 
                 https://www.listendata.com/2019/05/create-animation-in-r-learn-with.html

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

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

priceBond<-function(YTM,couponRate,freq,fv,T){
   r<-YTM/freq
   c<-fv*couponRate/freq
   n<-T*freq

   pvCoupon<-c/r*(1-1/(1+r)^n)
   pvFV<-fv/(1+r)^n
   price<-pvCoupon+pvFV
   return(price)
}

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

Generate your own data 
////////////////////////////
 Step 1: launch Excel, then enter values
         Country 2000 2001  
          haha1
          haha2

   x<-read.table('clipboard',hedaer=T)
   # x<-read.table(pipe("pbpaste"), header=T)
   names<-colnames(x)
   names2<-gsub('X','',names)
   .x<-x

    dataSource<-'haha1'
    title     <-'haha2'
    subTitle<-'(haha3)'
    gifName<-'haha.gif'
   .movingGIF(.x,dataSource,gifName,title,subTitle)

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