title: R is passing list index value as numeric, how to force pass as characters
body: <p>I have some code which passes a list containing some strings to another function. Thing is the new function doesn't use the string associated with the index, but rather uses the index number. </p>
  
  <p>How do I force it to use the string value behind the index value? </p>
  
  <p>My code</p>
  
  <pre><code>  for (i in 1:length(cList)) {
  
      cList[i] &lt;- GetData(cList[i], StartMonth, StartNumberofMonth, StartYear, EndMonth, EndNumberofMonth, EndYear)
  
        }
  
  
  GetData &lt;- function (TickerID, StartMonth, StartNumberofMonth, StartYear, EndMonth, EndNumberofMonth, EndYear) {
  
    url1 &lt;- "http://real-chart.finance.yahoo.com/table.csv?s="
    url2 &lt;- paste0(TickerID, "&amp;a=", StartMonth-1, "&amp;b=")
    url3 &lt;- paste0(StartNumberofMonth, "&amp;c=", StartYear)
    url4 &lt;- paste0("&amp;d=", EndMonth -1, "&amp;e=", EndNumberofMonth)
    url5 &lt;- paste0("&amp;f=", EndYear, "&amp;g=d&amp;ignore=.csv")
    #/ Generate CSV URL link
        url.final &lt;- paste(url1, url2, url3, url4, url5)
  
  }
  </code></pre>
  
  <p>When I write print (<code>url.final</code>) I get</p>
  
  <pre><code>[1] "http://real-chart.finance.yahoo.com/table.csv?s= 4&amp;a=1&amp;b= 1&amp;c=2013 &amp;d=1&amp;e=1 &amp;f=2015&amp;g=d&amp;ignore=.csv"
  </code></pre>
  
  <p>TickerID List</p>
  
  <pre><code>[1] BABA
  Levels: ABBV ABEV ACT BABA KMI LFC MA ORCL TSM UPS
  </code></pre>
  
  <p>As you can see, the index value has been used, not the string behind it. I already tried casting <code>TickerID</code> with <code>as.character</code>, with the same result (not working).</p>