包TSclust中有一个名为MINDIST.SAX
的函数。这是函数的主体:
require(TSclust)
> MINDIST.SAX
function (x, y, alpha, n)
{
w <- length(x)
symb <- SAX.breakpoints.table(alpha)
d <- 0
for (i in 1:w) {
xi <- x[i]
yi <- y[i]
if (abs(xi - yi) > 1) {
d <- d + (symb[max(xi, yi)] - symb[min(xi, yi) +
1])^2
}
}
sqrt((n/w) * d)
}
<environment: namespace:TSclust>
如上所示,还有一个名为SAX.breakpoints.table
的函数已被重新调用。
我需要知道这个函数的确切定义(即SAX.breakpoints.table
)。我试过了SAX.breakpoints.table
> SAX.breakpoints.table
Error: object 'SAX.breakpoints.table' not found
以及:
> ls("package:TSclust")
[1] "cluster.evaluation" "convert.to.SAX.symbol" "diss" "diss.ACF"
[5] "diss.AR.LPC.CEPS" "diss.AR.MAH" "diss.AR.PIC" "diss.CDM"
[9] "diss.CID" "diss.COR" "diss.CORT" "diss.DTWARP"
[13] "diss.DWT" "diss.EUCL" "diss.FRECHET" "diss.INT.PER"
[17] "diss.MINDIST.SAX" "diss.NCD" "diss.PACF" "diss.PDC"
[21] "diss.PER" "diss.PRED" "diss.SPEC.GLK" "diss.SPEC.ISD"
[25] "diss.SPEC.LLR" "loo1nn.cv" "MINDIST.SAX" "PAA"
[29] "pvalues.clust"
但我找不到了!
答案 0 :(得分:0)
>TSclust:::SAX.breakpoints.table
function (n)
{
qnorm(0:n/n)
}
<environment: namespace:TSclust>
这个问题view source code in R将有助于查看包中的任何功能,甚至是隐藏的功能。
希望这有帮助