Fixed syntax
This commit is contained in:
parent
8eb81c51d2
commit
4520fd30fb
3 changed files with 13 additions and 15 deletions
|
|
@ -13,7 +13,7 @@ cluster_own <- function(Z, nclust) {
|
|||
} else {
|
||||
clsnum <- 1
|
||||
for (k in (m - maxclust + 1):(m - 1)) {
|
||||
i = Z(k, 1) # left tree
|
||||
i = Z[k, 1] # left tree
|
||||
if (i <= m) { # original node, no leafs
|
||||
T[i] = clsnum
|
||||
clsnum = clsnum + 1
|
||||
|
|
@ -21,7 +21,7 @@ cluster_own <- function(Z, nclust) {
|
|||
T <- clusternum(Z, T, i - m, clsnum)
|
||||
clsnum <- clsnum + 1
|
||||
}
|
||||
i <- Z(k, 2) # right tree
|
||||
i <- Z[k, 2] # right tree
|
||||
if (i <= m) { # original node, no leafs
|
||||
T[i] <- clsnum
|
||||
clsnum <- clsnum + 1
|
||||
|
|
|
|||
|
|
@ -1,16 +1,14 @@
|
|||
clusternum <- function(X, T, k, c) {
|
||||
m <- size(X, 1) + 1
|
||||
while (!is.null(k)) {
|
||||
# % Get the children of nodes at this level
|
||||
while (!isempty(k)) {
|
||||
# Get the children of nodes at this level
|
||||
children <- X[k, 1:2]
|
||||
children <- children[, ]
|
||||
|
||||
# % Assign this node number to leaf children
|
||||
# Assign this node number to leaf children
|
||||
t <- (children <= m)
|
||||
T[children(t)] <- c
|
||||
|
||||
# % Move to next level
|
||||
k <- children(!t) - m
|
||||
T[children[t]] <- c
|
||||
# Move to next level
|
||||
k <- children[!t] - m
|
||||
}
|
||||
return(T)
|
||||
}
|
||||
|
|
@ -77,10 +77,10 @@ greedyMix <- function(
|
|||
# h0 = findobj('Tag','filename1_text');
|
||||
# set(h0,'String',filename); clear h0;
|
||||
message(
|
||||
'When using data which are in BAPS-format,',
|
||||
'you can specify the sampling populations of the',
|
||||
'individuals by giving two additional files:',
|
||||
'one containing the names of the populations,',
|
||||
'When using data which are in BAPS-format, ',
|
||||
'you can specify the sampling populations of the ',
|
||||
'individuals by giving two additional files: ',
|
||||
'one containing the names of the populations, ',
|
||||
'the other containing the indices of the first ',
|
||||
'individuals of the populations.'
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue