title: R error in eval Function
body: <p>hi all I'm trying to create a function in R to clean data... the following code is part of it.</p>
  
  <pre><code>limpio=function (tabla, campo, campo_conteo){
  
    tabla1&lt;-aggregate(campo_conteo ~ campo, tabla, length)
    colnames(tabla1)[2]&lt;-"frecuencia"
    tabla2 &lt;- gsub('\\s+','',toupper(tabla1$campo)) 
    View(tabla2) }
  </code></pre>
  
  <p>So, when I run: </p>
  
  <pre><code>limpio(vendidos, Nacionality, CustomerID)
  </code></pre>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>Error in eval(expr, envir, enclos) : object 'CustomerID' not found</p>
  </blockquote>
  
  <p>But the column does exist, so don't know what's the problem.</p>
  
  <pre><code>colnames(vendidos)
  
   #[1] "ID"             "CampaignID"     "CustomerID"     "PhoneID"        "Name"          
   #[6] "NumberType"     "Number"         "Birthday"       "Sex"            "Holder"        
  #[11] "HolderNumber"   "Nacionality"    "Address"        "City"           "Zip"  
  </code></pre>