Links
//////////////////////////////////////////////////////////
 Carpentries, 2018, Loops in R
    https://swcarpentry.github.io/r-novice-inflammation/15-supp-loops-in-depth/

  R if else Statement
      https://www.datamentor.io/r-programming/if-else-statement/

  Vries, Andrie de and Joris Meys,How to use R if condition 
      https://www.dummies.com/programming/r/how-to-use-if-statements-in-r/
//////////////////////////////////////////////////////////

apropos("date")
//////////////////////////////////////////////////////////
> apropos("date")
 [1] "-.Date"             ".Date"              ".indexDate"         "[.Date"            
 [5] "[[.Date"            "[<-.Date"           "+.Date"             "as.character.Date" 
 [9] "as.data.frame.Date" "as.Date"            "as.Date"            "as.Date.character" 
[13] "as.Date.default"    "as.Date.factor"     "as.Date.numeric"    "as.Date.numeric"   
[17] "as.Date.POSIXct"    "as.Date.POSIXlt"    "as.Date.ts"         "as.Date.yearmon"   
[21] "as.Date.yearqtr"    "as.list.Date"       "as.POSIXct.Date"    "as.POSIXlt.Date"   
[25] "asDateBuilt"        "axis.Date"          "c.Date"             "cut.Date"          
[29] "date"               "dates"              "diff.Date"          "format.Date"       
[33] "http_date"          "is.numeric.Date"    "ISOdate"            "ISOdatetime"       
[37] "julian.Date"        "length<-.Date"      "Math.Date"          "mean.Date"         
[41] "months.Date"        "Ops.Date"           "packageDate"        "parse_http_date"   
[45] "print.Date"         "quarters.Date"      "rep.Date"           "round.Date"        
[49] "seq.Date"           "split.Date"         "summary.Date"       "Summary.Date"      
[53] "Sys.Date"           "trunc.Date"         "update"             "update.default"    
[57] "update.formula"     "update.packages"    "weekdays.Date"      "xml_validate"      
[61] "xtfrm.Date"        

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

paste() and paset0() functions
///////////////////////////

The paste() function is vitally essential for string manipulation. Below, we combine two words by applying this function. 
x<-"Hello"
y<-"World!"
paste(x,y,sep=" ") # sep is separator
paste(x,y)         #  default value is def=" "
If we don’t want any space between, we use sep="".
path<-"http://datayyy.com/data_csv/"
file<-"sp500daily.csv"
infile<-paste(path,file,sep="") 
x<-read.csv(infile)
print(head(x))
Alternatively, we can apply the paste0() function instead. 
path<-"http://datayyy.com/data_csv/"
file<-"sp500daily.csv"
infile<-paste0(path,file) 

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