Converting a list into a matrix 
///////////////////////
  We can try various ways to achieve this objective. 

   unlist() function 

   as.matrix() function 

   matrix() function 

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

subset() function
///////////////////////

x<- data.frame(
	  Name = c("Orange", "Apple", "Lemon", "Banana", 
		"Grapefruit", "Strawberry"),
	  Type=c("Citrus","Pome","Citrus","Berry","Citrus", "Berry"),
	  Price = c(1.00, 1.50, 0.75, 0.50, 1.25, 2.00)
	)

cheap_fruits <- subset(df, Price < 1.00)
print(cheap_fruits)

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

change current working directory
///////////////////////////
# get the current working directory 
  getwd()

  a<-getwd()

#----- create a temp directory ------- #
  dir.create('temp')    

  setwd('temp')

# ----- back to the upper level ------- #
   getwd('..')

# ----- back to two upper levels ------- #
 setwd("../..")

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

Youtubes
///////////////////////
Malakar,Gopal,2017, How to Merge Data Sets (join) in R
     (v20k,s7k,t3:04)
     https://www.youtube.com/watch?v=RNmgnVvcfU4

GordonAnthonyDavis,R Programming Tutorial Lesson 16: Merging Data Frames
     (v35k,s4k,t7:03)
     https://www.youtube.com/watch?v=rkmIASiE8iI
///////////////////////

Manually download one quarterly index for SEC filings
///////////////////////////
 Task: Manually download one daily index file (company.20100106.idx)
       from the SEC website, then retrieve it to Excel 

  Step 1: Go to https://www.sec.gov/Archives/edgar/daily-index/ 
  Step 2: Choose 2010
  Step 3: Choose QTR1
  Step 4: Download company.20100106.idx

  Step 5: Retrieve it to Excel
          launch Excel -> [find the file]
                       -> Get Data
                       -> legacy wizard
                       -> from text (legacy)
                       -> Fixed width
                       -> [Next]
                          Move down to true data part
                          Merge vertical lines to 'cut' the data correctly
                          In total 5 data columns
                       -> [Finish]
                       -> [Choose a starting cell, such as A1]
                       -> [OK]

    Try the first obs of variable 5
       edgar/data/38723/0000038723-10-000002.txt

       https://www.sec.gov/Archives/edgar/daily-index/ 

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