Displaying 10 results from an estimated 10 matches for "distmat".
2005 Oct 19
1
clustering algorithm detail
Hi all,
I wanted to run the hclust (or any other clustering algorithm) on a distance matrix. I have formed the distance matrix as:
distmat:
a b c d e
a 0.00 0.96 1.60 1.60 1.68
b 0.96 0.00 0.96 1.80 2.64
c 1.60 0.96 0.00 0.84 1.80
d 1.60 1.80 0.84 0.00 0.96
e 1.68 2.64 1.80 0.96 0.00
Now, I would like to run a clustering a...
2005 Apr 05
4
lists: removing elements, iterating over elements,
...alculate overlapping U-diametric clusters of a given radius.
(Again, I apologize this looks so much like C.)
## Returns a list of all U-diametric clusters of a given radius
## Give an R distance matrix
## Clusters may overlap. Clusters may be identical (redundant)
getUDClusters <-function(distmat,radius){
mem <- list()
nItems <- dim(distmat)[1]
for ( i in 1:nItems ){
mem[[i]] <- c(i)
}
for ( m in 1:nItems ){
for ( n in 1:nItems ){
if (m != n & (distmat[m,n] <= radius)){
##item is within radius, so add to collection m
mem[[m]] <...
2006 Nov 09
1
dissimilarity matrices
Dear All,
I have a dissimilarity matrix which I happily convert to a distance object
by running:
X <- as.dist(Y)
and I can happily now run either hclust(X) or agnes(X).
So that the various bits of output are labelled correctly I would dearly
like to be able to give names to the columns and rows of X, as would happen
if I ran:
mydata<-read.table("clipboard",header=T)
2013 May 01
1
help understanding hierarchical clustering
...uot;http://epi.whoi.edu/ipython/results/mdistefano/pg_site1.csv",header=T)
dd <- mat[!is.na(mat$idcode) &
!is.na(mat$temp) &
!is.na(mat$sal) &
!is.na(mat$count) &
!is.na(mat$count) &
!is.na(mat$subs),]
distmat<-vegdist(dd)
clusa<-hclust(distmat,"average")
print(clusa)
Call:
hclust(d = distmat, method = "average")
Cluster method : average
Distance : bray
Number of objects: 8036
print(dend1 <- as.dendrogram(clusa))
'dendrogram' with 2 branches and 8...
2012 Jan 07
1
k-means++
Hi everyone -
I know that R is capable of clustering using the k-means algorithm, but can
R do k-means++ clustering as well?
Thanks,
--
Dr. Ferebee Tunno
Assistant Professor
Department of Mathematics and Statistics
Arkansas State University
P.O. Box 70
State University, AR. 72467
ftunno@astate.edu
(870) 329-7710
[[alternative HTML version deleted]]
2006 Jul 28
2
subset of rows from matrix
Hi all,
I have a dataframe of rownames that I would like to extract from a
larger matrix to form a new matrix. I have tried to use subset, in
this manner
x<-subset(largematrix, rownames$names=largematrix$rownames)
where largematrix is the larger matrix and rownames$names is the
dataframe with the row names of the rows I want to extract from the
larger matrix.
Of course, I get error
2013 Mar 05
0
permutest
...constraining
variable. I've read the documentation, but setting first=FALSE or using
by="axis" doesn't seem to be helping. capscale seems to be fine, I receive
output for more than one constrained axis. What am I doing wrong?
capscale.Nrem.results<-capscale(as.dist(qiime.data$distmat)~
N+rem+N*rem+Condition(dateFac), factor.frame)
capscale.Nrem.results
Inertia Proportion Rank
Total 1.454538
Real Total 1.459802 1.000000
Conditional 0.117117 0.080228 1
Constrained 0.386228 0.264576 3
Unconstrained 0.956457 0.655197 22
Imaginar...
2017 Dec 31
1
Perform mantel test on subset of distance matrix
...ps ecological relationships become less relevant that stochastic
processes above a certain threshold.
The problem is that I can't find a way to do it. If I replace values
in either or both of the distance matrices with NA, mantel.rtest (ade4
package) gives the following error: Error in if (any(distmat < tol))
warning("Zero distance(s)") : missing value where TRUE/FALSE needed
Here's a trivial example that tries to exclude elements of the first
matrix that equal 11:
library(ade4)
a <- matrix(data = 1:36, nrow = 6)
b <- matrix(data = 1:36, nrow = 6)
a[a==11] <- NA
mante...
2013 Jan 11
3
locating element in distance matrix
Dear useRs,
I have a very basic question. I have a distance matrix and i skipped the upper part of it deliberately. The distance matrix is 1000*1000. Then i used "min" command to extract the lowest value from that matrix. Now i want to know what is the location of that lowest element? More precisely, the row and column number of that lowest element.
Thanks in advance
elisa
2007 Jul 24
0
Fitting the best line to the plot of distance vs. correlation matrix
Hi all,
Thanks for your help in generating the matrix of distance vs correlation. I did it using
plot(as.vector(as.matrix(cormat)), as.vector(as.matrix(distmat)))
Now I want to quantitate the same. May be on linear regression or some other statistical functions. I have tried using linmod for linear regression. But as I have two matrices in the form of the dataframes, I'm wondering if it is the right way to do it in this? Or are there even better opti...