title: Error in as.double(y) : cannot coerce type 'S4' to vector of type 'double'
body: <p>I am applying Aprior algorithm, and while plotting there is an error.     </p>
  
  <p>I have installed packages <code>arules</code> and <code>arulesviz</code>.</p>
  
  <p>The data has 3 attributes . Two were factorized and one attribute was not factorized. I have taken that attribute attribute separately and applied factor function. The code is below:</p>
  
  <pre><code>New_Train_Wifi = read.xlsx("D:/Train_Test.xls",1)
  
  str(New_Train_Wifi)
  'data.frame':   2201 obs. of  3 variables:
   $ Wifi_ID: Factor w/ 4 levels "1st","2nd","3rd",..: 3 3 3 3 3 3 3 3 3 3 ...
   $ Store  : Factor w/ 5 levels "Book_Store","Clothing",..: 3 3 3 3 3 3 3 3 3 3 ...
   $ Mac_ID : num  125 125 125 125 125 125 125 125 125 125 ...
  
  A &lt;- as.factor(Test_ARM_ABC$Wifi_ID)
  C &lt;- as.factor(New_Train_Wifi$Mac_ID)
  New_Train_Wifi$MacID &lt;- NULL
  New_Train_Wifi$MacID &lt;- C
  New_Train_Wifi$Mac_ID &lt;- NULL
  
  class(New_Train_Wifi)
  [1] "data.frame"
  [1] "Wifi_ID" "Store"   "MacID" 
  str(New_Train_Wifi)
  'data.frame':   2201 obs. of  3 variables:
   $ Wifi_ID: Factor w/ 4 levels "1st","2nd","3rd",..: 3 3 3 3 3 3 3 3 3 3 ...
   $ Store  : Factor w/ 5 levels "Book_Store","Clothing",..: 3 3 3 3 3 3 3 3 3 3 ...
   $ MacID  : Factor w/ 6 levels "100","125","254",..: 2 2 2 2 2 2 2 2 2 2 ...
  
  rules &lt;- apriori(New_Train_Wifi)
  inspect(rules)
  rules &lt;- apriori(New_Train_Wifi, parameter = list(minlen = 2, supp = 0.10, conf = 0.8), 
                   appearance = list(rhs = c("Wifi_ID=1st", "Wifi_ID=2nd", "Wifi_ID=3rd", 
                   "Wifi_ID=4th"), default="lhs"), control = list(verbose = F))
  
  &gt; inspect(rules.sorted)
  
  #/*Now wen I give below statement in r console */
  &gt; plot(rules)
  </code></pre>
  
  <blockquote>
  <pre><code>Error in as.double(y) : 
   cannot coerce type 'S4' to vector of type 'double'
  </code></pre>
  </blockquote>
  
  <p>Above statement is the error I tried to but couldn't resolve . If anyone can resolve it, I will be really grateful.</p>
  
  <p>The site that I referred to: <a href="http://www.rdatamining.com/examples/association-rules" rel="noreferrer">http://www.rdatamining.com/examples/association-rules</a></p>