【发布时间】:2014-04-22 06:30:18
【问题描述】:
包变更点
我想从下面的表达式 Slot "cpts": cpt 36 40 中提取,但不知道该怎么做。
x<-c(1,2,3,4,5,1,2,3,4,4,5,6,7,8,9,1,2,3,4,5,6,7,8,2,1,1,2,3,4,5,3,2,3,5,4,3,2,1,1,1)
cpt.meanvar(x,penalty="SIC",pen.value=0,method="AMOC",Q=5,test.stat="Normal")
An object of class "cpt"
Slot "data.set":
Time Series:
Start = 1
End = 40
Frequency = 1
[1] 1 2 3 4 5 1 2 3 4 4 5 6 7 8 9 1 2 3 4 5 6 7 8 2 1 1 2 3 4 5 3 2 3 5 4 3 2 1 1 1
Slot "cpttype":
[1] "mean and variance"
Slot "method":
[1] "AMOC"
Slot "test.stat":
[1] "Normal"
Slot "pen.type":
[1] "SIC"
Slot "pen.value":
[1] 7.377759
Slot "cpts":
cpt
36 40
Slot "ncpts.max":
[1] 1
Slot "param.est":
$mean
[1] 3.833333 1.250000
$variance
[1] 4.657143 0.250000
Slot "date":
[1] "Fri Apr 18 07:51:17 2014"
试过了
cpDxu2[[1]]
Error en cpDxu2[[1]] : this S4 class is not subsettable
cpDxu2$cpt
Error en cpDxu2$cpt : $ operator not defined for this S4 class
我想提取系数 cpt 36 40
另一方面,我似乎没有在包中找到任何关于提取不同元素的说明。欢迎任何帮助
【问题讨论】:
标签: r