# Although names are not required, they aid clarity. The cost matrix
# has sum(z) rows and sum(1-z) columns, where z is a binary vector.
# If needed, it is easier to connect an entry in z to a row or column in
# cost if they have the same name. If z has names, the data matrix should
# have the same names.
data(aHDLt)
rownames(aHDLt)<-aHDLt$SEQN
z<-aHDLt$z
names(z)<-aHDLt$SEQN
dist<-startcost(z)
dist[1:3,1:9]
Run the code above in your browser using DataLab