【问题标题】:arulesViz subscript out of bounds paracoordarulesViz 下标越界 paracoord
【发布时间】:2019-01-11 22:23:59
【问题描述】:

我想执行篮子分析并绘制平行坐标图,但是收到错误消息。

这个错误的内容是::

Error in m[j, i] : subscript out of bounds.In addition: Warning message:
In cbind(pl, pr) :
number of rows of result is not a multiple of vector length (arg 2)

我使用的数据来自:Link

首先我将其转换为适合篮子分析,原始 excel 文件的名称是 Online_Retail:

library(arules)
library(arulesViz)
library(plyr)
items <- ddply(Online_Retail, c("CustomerID", "InvoiceDate"),             function(df1)paste(df1$Description, collapse = ","))
items1 <- items["V1"]
write.csv(items1, "groceries1.csv", quote=FALSE, row.names = FALSE, col.names = FALSE)

trans1 <- read.transactions("groceries1.csv", format = "basket", sep=",",skip=1)

为了绘制平行坐标,我创建了这样的代码:

rules.trans2<-apriori(data=trans1, parameter=list(supp=0.001,conf = 0.05), 
                  appearance=list(default="rhs", lhs="ROSES REGENCY TEACUP AND SAUCER"), control=list(verbose=F)) 

sorted.plot <- sort(rules.trans2, by="support", decreasing = TRUE)
plot(sorted.plot, method="paracoord", control=list(reorder=TRUE, verbose = TRUE))

为什么我的 paracoord 代码不起作用?我该如何解决?我应该改变什么?

【问题讨论】:

    标签: r statistics associations arules


    【解决方案1】:

    不幸的是,这是 arulesViz 中的一个错误。这将在下一个版本(arulesViz 1.3-3)中修复。该修复程序已在 GitHub 上的开发版本中提供:https://github.com/mhahsler/arulesViz

    【讨论】:

    • 谢谢!感谢您的帮助。
    猜你喜欢
    • 1970-01-01
    • 2014-12-12
    • 1970-01-01
    • 2023-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多