1

The items column in the transactions I am passing to the fpgrowth method are of the form

  {     
        Bag of Organic Bananas, 
        Cornbread Mix,                                                                                                                                                        
        Green Chile Hummus,                                                                                                                                                   
        Guacamole,                                                                                                                                                            
        Lightly Salted Chips,                                                                                                                                                 
        Multi-Seeds Cracker,                                                                                                                                                  
        Organic Cucumber,                                                                                                                                                     
        Organic Genoa Salami,                                                                                                                                                 
        Organic Navel Orange,                                                                                                                                                 
        Organic Stoneground Wheat Crackers,                                                                                                                                   
        Organic Whole String Cheese,                                                                                                                                          
        Salted Butter,                                                                                                                                                        
        Seedless Red Grapes,                                                                                                                                                  
        Tilapia Filet
    } 

Here I am trying to find products that are frequently together in a transaction.

rules = rCBA::fpgrowth(transactions, support=0.1, confidence=0.1, maxLength=2, parallel=FALSE)

While the example here has the following key-value form for items in transactions

    {
       Sepal.Length=5.1,                
       Sepal.Width=3.5,                 
       Petal.Length=1.4,                
       Petal.Width=0.2,                 
       Species=setosa
    }

This example goes on to use "Species" in the consequent parameter

rules = rCBA::fpgrowth(txns, support=0.03, confidence=0.03, maxLength=2, consequent="Species", parallel=FALSE)

As I am new to R, I can't figure out what to do to convert my transactions to this format and what should I put as consequent.

kenneth-rebello
  • 914
  • 1
  • 7
  • 13

0 Answers0