library(arules)
  library(arulesViz)
package ‘arulesViz’ was built under R version 3.5.2Loading required package: grid

Step 1: Load data

# read in the data
  load("termDocMatrix.rdata")
  # store the data in a new object called "Data"
  Data <- termDocMatrix
  # check the first 5 rows of the matrix
  head(Data,5)

  Data[Data>1] <- 1
  # sets values greater than 1 to one for simple rule mining

Step 2: Transpose the matrix

  df <- t(Data)
  # check the first 5 rows to make sure the transpose was done correctly
  head(df,5)

  # coerce df to a transaction class. as() is an arules function 
  d <- as(df, "transactions")
  itemFrequencyPlot(d)

There are many other analysis which offer other insights in arules(). Check them here: Association Mining with R and arules

LS0tCnRpdGxlOiAiTGFiIDkgU3RhcnRlciBDb2RlIgpvdXRwdXQ6IGh0bWxfbm90ZWJvb2sKLS0tCgpgYGB7ciBzZXR1cCwgaW5jbHVkZT1UUlVFLCB3YXJuaW5nPUZBTFNFLG1lc3NhZ2U9RkFMU0V9CiAgbGlicmFyeShhcnVsZXMpCiAgbGlicmFyeShhcnVsZXNWaXopCmBgYAoKIyMgU3RlcCAxOiBMb2FkIGRhdGEKYGBge3J9CiMgcmVhZCBpbiB0aGUgZGF0YQogIGxvYWQoInRlcm1Eb2NNYXRyaXgucmRhdGEiKQogICMgc3RvcmUgdGhlIGRhdGEgaW4gYSBuZXcgb2JqZWN0IGNhbGxlZCAiRGF0YSIKICBEYXRhIDwtIHRlcm1Eb2NNYXRyaXgKICAjIGNoZWNrIHRoZSBmaXJzdCA1IHJvd3Mgb2YgdGhlIG1hdHJpeAogIGhlYWQoRGF0YSw1KQoKICBEYXRhW0RhdGE+MV0gPC0gMQogICMgc2V0cyB2YWx1ZXMgZ3JlYXRlciB0aGFuIDEgdG8gb25lIGZvciBzaW1wbGUgcnVsZSBtaW5pbmcKYGBgCiAKIyMgU3RlcCAyOiBUcmFuc3Bvc2UgdGhlIG1hdHJpeApgYGB7cn0KICBkZiA8LSB0KERhdGEpCiAgIyBjaGVjayB0aGUgZmlyc3QgNSByb3dzIHRvIG1ha2Ugc3VyZSB0aG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