title: how to extract information from apriori R (association rules)
body: <p>I am doing some association rules mining in R and want to extract my results so I can build reports
  my results look like this:</p>
  
  <pre><code>&gt; inspect(rules[1:3])
    lhs          rhs                         support confidence lift
  1 {apples} =&gt; {oranges}                    0.00029       0.24  4.4
  2 {apples} =&gt; {pears}                      0.00022       0.18 45.6
  3 {apples} =&gt; {pineapples} 0.00014         0.12  1.8
  </code></pre>
  
  <p>How do i extract the "rhs" here i.e. a vector of oranges, pears and pineapples</p>
  
  <p>Further how do I extract information out of the summary i.e.</p>
  
  <pre><code>&gt; summary(rules)
  </code></pre>
  
  <p>The data type is "s4" and have no problem extracting when the output is in the list etc.. how do you do the equivelant?
      set of 3 rules</p>
  
  <pre><code>rule length distribution (lhs + rhs):sizes
  2 
  3 
  
     Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
        2       2       2       2       2       2 
  </code></pre>
  
  <p>I want to extract the "3" from the "set of 3 rules"</p>
  
  <p>I have gotten as far as using "@" 
  <a href="https://stackoverflow.com/questions/1908010/what-does-the-symbol-mean-in-r/1908095#1908095">What does the @ symbol mean in R?</a></p>
  
  <p>But once i use that, how do i turn my results into a vector i.e. </p>
  
  <pre><code>inspect(rules@rhs)
  1 {oranges}
  2 {pears}
  3 {pineapples}
  </code></pre>
  
  <p>becomes character vector of length 3</p>