将apriori生成的规则输出到R中的PDF中
我的算法非常基本,它从CSV读取一组数据,并对数据进行分析 默认情况下,长方体/马赛克/条形图在pdf频道上输出时很容易 问题出现在将apriori生成的规则输出到R中的PDF中,r,pdf,output,R,Pdf,Output,我的算法非常基本,它从CSV读取一组数据,并对数据进行分析 默认情况下,长方体/马赛克/条形图在pdf频道上输出时很容易 问题出现在inpect(rules)中,其中rules是应用apriori算法产生的一组规则 我尝试了textplot(检查(规则))=>错误: Error in max(sapply(unlist(slist), strwidth, cex = cex)) : invalid 'type' (list) of argument Error in as.charact
inpect(rules)
中,其中rules是应用apriori
算法产生的一组规则
我尝试了textplot(检查(规则))
=>错误:
Error in max(sapply(unlist(slist), strwidth, cex = cex)) :
invalid 'type' (list) of argument
Error in as.character.default(<S4 object of class "rules">) :
no method for coercing this S4 class to a vector
还有textplot(规则)
=>错误:
Error in max(sapply(unlist(slist), strwidth, cex = cex)) :
invalid 'type' (list) of argument
Error in as.character.default(<S4 object of class "rules">) :
no method for coercing this S4 class to a vector
as.character.default()中的错误:
没有将此S4类强制为向量的方法
有没有一种方法可以使用绘图输出这些规则(这样会更好),因为这样会更具可读性
或者,作为将打印(检查(规则))返回的内容作为基本文本输出到pdf的最终解决方案。在搜索类似内容时遇到此问题。在这里为稍后的任何人提供答案
这里的主要挑战是,将规则转换为文本
我观察到的是,从arules检查基本上“显示”了输出。不能将其分配给其他变量或以任何其他方式使用。对于以编程方式将规则转换为文本,inspect没有用处
我发现,将规则转换为文本的正确方法是:
现在,您可以使用自己喜欢的技术将数据帧打印为文本