title: How to use Cl() with character?
body: <p>I have a list of symbols in a csv file and I want to screen for the ones with closing price higher than 5. </p>
  
  <p>I already ran getSymbols for all items in the csv file.</p>
  
  <p>My test runs into error here. I think it's because Cl() doesn't accept characters as arguments. How can I convert character to xts?</p>
  
  <pre><code>&gt; library(quantmod)
  
  &gt; passingset
           V1
  1       AAB
  2    AAR-UN
  3       AAV
  4       ABT
  5       ABX
         (...)
  
  &gt; class(passingset)
  [1] "data.frame"
  &gt; class(passingset$V1)
  [1] "character"
  
  
  &gt; #Remove closing price &lt; 5
  &gt; for (i in 1:nrow(passingset)){
  +   company &lt;- passingset$V1[i]
  +   if(Cl(company)[length(Cl(company))] &lt; 5){
  +     passingset &lt;- passingset[!(passingset$V1 == company),, drop = FALSE]
  +   } else 
  +       i = i + 1
  +   
  +   rm(company)
  + }
  **Error in Cl(company) : 
    subscript out of bounds: no column name containing "Close"**
  </code></pre>