楼主: BBS66
2016 1

[问答] Error in slot(x, s)[i] : subscript out of bounds [推广有奖]

  • 0关注
  • 0粉丝

等待验证会员

小学生

28%

还不是VIP/贵宾

-

威望
0
论坛币
7 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
56 点
帖子
5
精华
0
在线时间
0 小时
注册时间
2018-10-13
最后登录
2018-10-13

楼主
BBS66 发表于 2018-10-13 13:39:04 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
救救孩子吧
这是怎么肥事?怎么改才好?     Error in slot(x, s) : subscript out of bounds
R version 3.5.1 (2018-07-02) -- "Feather Spray"
Copyright (C) 2018 The R Foundation for Statistical Computing
Platform: x86_64-w64-mingw32/x64 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(arules)
载入需要的程辑包:Matrix

载入程辑包:‘arules’

The following objects are masked from ‘package:base’:

    abbreviate, write

> library(arulesViz)
载入需要的程辑包:grid
> dt<-read.table("mba.txt",header=T)
> mba<-as(dt,"transactions")
> rules=apriori(mba,parameter=list(support=0.03,confidence=0.4,minlen=2,maxlen=2))
Apriori

Parameter specification:
confidence minval smax arem  aval originalSupport
        0.4    0.1    1 none FALSE            TRUE
maxtime support minlen maxlen target   ext
       5    0.03      2      2  rules FALSE

Algorithmic control:
filter tree heap memopt load sort verbose
    0.1 TRUE TRUE  FALSE TRUE    2    TRUE

Absolute minimum support count: 5

set item appearances ...[0 item(s)] done [0.00s].
set transactions ...[27 item(s), 179 transaction(s)] done [0.00s].
sorting and recoding items ... [22 item(s)] done [0.00s].
creating transaction tree ... done [0.00s].
checking subsets of size 1 2 done [0.00s].
writing ... [19 rule(s)] done [0.00s].
creating S4 object  ... done [0.00s].
Warning message:
In apriori(mba, parameter = list(support = 0.03, confidence = 0.4,  :
  Mining stopped (maxlen reached). Only patterns up to a length of 2 returned!
> summary(rules)
set of 19 rules

rule length distribution (lhs + rhs):sizes
2
19

   Min. 1st Qu.  Median    Mean 3rd Qu.    Max.
      2       2       2       2       2       2

summary of quality measures:
    support          confidence          lift      
Min.   :0.03352   Min.   :0.4048   Min.   :1.362  
1st Qu.:0.10056   1st Qu.:0.4988   1st Qu.:1.637  
Median :0.16760   Median :0.6122   Median :2.275  
Mean   :0.14760   Mean   :0.6505   Mean   :2.216  
3rd Qu.:0.17318   3rd Qu.:0.7941   3rd Qu.:2.578  
Max.   :0.31844   Max.   :0.9661   Max.   :3.236  
     count      
Min.   : 6.00  
1st Qu.:18.00  
Median :30.00  
Mean   :26.42  
3rd Qu.:31.00  
Max.   :57.00  

mining info:
data ntransactions support confidence
  mba           179    0.03        0.4
> x=sort(subset(rules,subset=lhs%pin%"=TRUE"&rhs%pin%"=TRUE"&lift>=1),by="support")
> inspect(x[1:10])
Error in slot(x, s) : subscript out of bounds
mba.txt (9.8 KB)

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

关键词:script Bounds Error Bound scrip

沙发
啊啊啊啊啊吖 发表于 2018-10-31 11:35:11
露朱重复发帖啦。。。。。

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-22 15:40