Google docs -> PDF --> TXT
////////////////////////////
 Step 1: launch Google Docs
 Step 2: copy the following lines

pv<-100
r<-0.1
n<-5
fv_f<-function(pv,r,n){
      fv<-pv*(1+r)**n
      return(fv)
}

 Step 3: save your documnet as a PDF file 
         succh as my.pdf

 Step 4: Using the Adobe Acrobat Reader to 
         open the above saved PDF file. 

 Step 5: Click "File" -> "Save as Text ..."
         my.txt

 Step 6: Now you can use the source() function 
         to run  your code. 
/////////////////////////

ls() vs. ls(pattern='my-pattern')
///////////////////////

  ls()                # show all available variables and functions 
                      # i.e., show all objects

  ls(pattern="pv")  # show all objects containing 'pv'

  ls(pattern="^pv") # show all objects starting with 'pv'

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

typeof(), is.vector()
///////////////////////

  > typeof(10)
    [1] "double"

  > typeof('abc')
   [1] "character"

 To get all embedded functions starting with 'is.', 
    we issue the following code

    apropos("is.")

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

The round() function 
///////////////////////
After applying the round() or roundup() functions, 
    our numbers will become more readable. 

       input 1: our value

       input 2: number of digits

     =ROUND(1.2222,2)     -> 1.22

     =ROUND(1.2252,2)     -> 1.23

     =ROUNDUP(1.1444,2)   -> 1.15

     =ROUNDDOWN(1.1444,2) -> 1.14

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

Pie picture for CO2 emission by country in 2020
///////////////////////////////////////////////////////
Generate a pie for CO2 emission by country in 2020
     For example, here is the final result
                    http://datayyy.com/images/co2year2020.png

  Step 1: get the data, 
          http://datayyy.com/data_R/co2shares.RData
            or
          http://datayyy.com/data_csv/co2shares.csv                         

          The first several lines are given below. 
          > head(x)
            iso_code     country year share_global_co2
         1      AFG Afghanistan 1949                0
         2      AFG Afghanistan 1950                0
         3      AFG Afghanistan 1951                0
         4      AFG Afghanistan 1952                0
         5      AFG Afghanistan 1953                0
         6      AFG Afghanistan 1954                0

  Step 2: choose year 2020
  Step 3: sort the above data set by share_global_co2
  Step 4: choose a subset with the highest share_global_co2, such as top 20
  Step 5: remove non-country observations
  Step 6: generate a pie
  Step 7: add a tile, labels etc. 

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