title: R- sqldf error raw vs double
body: <p>I have a vector lims, with the limits of a score:</p>
  
  <pre><code> [1]  0.000000  7.025894  9.871630 12.411131 15.155998 18.099176 21.431354 25.391163 30.616550 40.356630
  </code></pre>
  
  <p>I create a table to classify other clients with:</p>
  
  <pre><code>lims[1]&lt;- -0.00001 
  a&lt;-data.frame(lims[2:10])
  colnames(a)&lt;-'maxSc'
  a&lt;-rbind(a, 100)
  lims&lt;-data.frame(lims)
  lims$maxSc&lt;-a
  colnames(lims)&lt;-c('minSc', 'maxSc')
  
  
  &gt; class(lims)
  [1] "data.frame"
  </code></pre>
  
  <p>So my result is:</p>
  
  <pre><code>&gt; lims
         minSc      maxSc
  1  -0.000010   7.025894
  2   7.025894   9.871630
  3   9.871630  12.411131
  4  12.411131  15.155998
  5  15.155998  18.099176
  6  18.099176  21.431354
  7  21.431354  25.391163
  8  25.391163  30.616550
  9  30.616550  40.356630
  10 40.356630 100.000000
  </code></pre>
  
  <p>I want to classify another table (train) according to those limits and the field sc:</p>
  
  <pre><code>&gt;class(train$sc)
  [1] "numeric"
  &gt; class(train$target)
  [1] "integer"
  </code></pre>
  
  <p>But when I run the following I get an error:</p>
  
  <pre><code>library(sqldf)
  sqldf("Select b.minSc, b.maxSc, count(*) as total, sum(target) as compra
       from  train a left join lims b 
      on a.sc&lt;=b.maxSc and a.sc&gt;b.minSc
      group by b.minSc, b.maxSc")
  </code></pre>
  
  <blockquote>
    <p>Error in sqliteSendQuery(conn, statement, bind.data) :    RAW() can
    only be applied to a 'raw', not a 'double'</p>
  </blockquote>
  
  <p>I don't understand what I'm doing wrong.</p>