search for: euclidean

Displaying 20 results from an estimated 294 matches for "euclidean".

2012 Nov 18
2
euclidean dist. between matrices
Dear Users,I have two matrices A=15*365 and B=1*365. i want to calculate "Euclidean Distance" between these matrices in such a way that i should have euclidean distance of matrix B against all the columns of matrix A. More precisely, first i want euclidean dist. of column 1 of A against B, then column 2 against B, 3rd column of A against B and so on.is there a way in r to do...
2010 Apr 26
2
Cluster analysis: dissimilar results between R and SPSS
...of 277 individuals measured on 8 binary variables (1=yes, 2=no). I did two similar cluster analyses, one on SPSS 18.0 and one on R 2.9.2. The objective is to have the means for each variable per retained cluster. 1) the R analysis ran as followed: > call data > dist=dist(data,method="euclidean") > cluster=hclust(dist,method="ward") > cluster Call: hclust(d = dist, method = "ward") Cluster method : ward Distance : euclidean Number of objects: 277 > plot(cluster) > rect.hclust(cluster, k=4, border="red") > x=rect.hclust(cluster...
2018 Mar 15
3
stats 'dist' euclidean distance calculation
Hello, I am working with a matrix of multilocus genotypes for ~180 individual snail samples, with substantial missing data. I am trying to calculate the pairwise genetic distance between individuals using the stats package 'dist' function, using euclidean distance. I took a subset of this dataset (3 samples x 3 loci) to test how euclidean distance is calculated: 3x3 subset used Locus1 Locus2 Locus3 Samp1 GG <NA> GG Samp2 AG CA GA Samp...
2009 Oct 21
2
squared euclidean distance
Dear R-Help-Team, I would like to cluster my data using the ward-method. In several papers I read (e.g. Bahrenberg) that it is neccesary to use the "squared euclidean distance" with the ward-method. Unfortunatelly I cannot find this term in r as a method for measuring the distance. Does anybody have an idea? Thanks in advance, Carolin [[alternative HTML version deleted]]
2013 May 02
2
Calculating distance matrix for large dataset
...e matrix with very large data set, and if anyone out there can confirm this error message I got actually mean that my data is too large for this task. negative length vectors are not allowed My data size and code used dim(mydata_nor)[1] 365000 144> d <- dist(mydata_nor, method = "euclidean") Here my data has 1000 samples each has a year data observed by 10 minutes interval daily, so the size is (365* 1000) * 144. I checked the manual of function 'dist' but can not see the upper limit size allowed, and I bet there should be one, so any hints is appreciated. I woul...
2011 Jul 06
1
relative euclidean distance
Hi, I would like to calculate the RELATIVE euclidean distance. Is there a function in R which does it ? (I calculated the abundance of 94 chemical compounds in secretion of several individuals, and I would like to have the chemical distance between 2 individuals as expressed by the relative euclidean distance. Some compounds are in very low abun...
2012 Aug 24
3
Euclidean distance function
...re functions exist to do what I want done, but have found myself completely incapable of writing them myself. The problem is that I have a table with several rows of species and several columns of trait data for each species. Now what I want to do is, for each possible pair of species, extract the Euclidean distance between them based on specified trait data columns. While as far as I can see the dist() function could manage this to some extent for 2 dimensions (traits) for each species, I need a more generalised function that can handle n-dimensions. Ideally this function would allow me to choose whi...
2017 Jun 18
2
dist function in R is very slow
Hi Stefan, Thank you very much for pointing me to the wordspace package. It does the job a bit faster than my C code but is 100 times more convenient. By the way, since the tcrossprod function in the Matrix package is so fast, the Euclidean distance can be computed very fast: euc_dist <- function(m) {mtm <- Matrix::tcrossprod(m); sq <- rowSums(m*m);? sqrt(outer(sq,sq,"+") - 2*mtm)} It takes less than 50 seconds for my (dense) matrix of 5,054 rows and 12,803 columns, while dist.matrix with method="euclidean&quot...
2010 Jun 24
2
Euclidean Distance Matrix Analysis (EDMA) in R?
I am studying on statistical shape analysis, I wonder is there any way or package available that I can perform Euclidean Distance Matrix Analysis (EDMA I or EDMA II) in R... thanks Gokhan -- View this message in context: http://r.789695.n4.nabble.com/Euclidean-Distance-Matrix-Analysis-EDMA-in-R-tp2266797p2266797.html Sent from the R help mailing list archive at Nabble.com.
1999 Jan 20
0
dist(*, "euclidean") [was "dist function suggestion"]
> BDR> You will need to call it something else: dist is a clone of an S > BDR> function, and dist(X, "manhattan") is well-established usage. > > one could still imagine an extra Y argument such that > dist(X, Y=myY, method="euclidean") > and dist(X, "euclidean", Y=myY) > would work > one could even make it such that > both > dist(X, myY) > and dist(X, "euclidean") > would work. However, the extra hack for dist(X, Y) Um, I did think about that, but precisely what would be rules b...
2004 Jan 21
1
outlier identification: is there a redundancy-invariant substitution for mahalanobis distances?
...e help archives I found a recommendation to do multivariate outlier identification by mahalanobis distances based on a robustly estimated covariance matrix and compare the resulting distances to a chi^2-distribution with p (number of your variables) degrees of freedom. I understand that compared to euclidean distances this has the advantage of being scale-invariant. However, it seems that such mahalanobis distances are not invariant to redundancies: adding a highly collinear variable changes the mahalanobis distances (see code below). Isn't also the comparision to chi^2 assuming that all variables...
2008 Jan 31
3
fastest way to compute the squared Euclidean distance between two vectors in R
I have a program which needs to compute squared Euclidean distance between two vectors million of times, which the Rprof shows is the bottleneck. I wondered if there is any faster way than my own simple function distance2 = function(x1, x2) { temp = x1-x2 sum(temp*temp) } I have searched the R-help archives and can not find anything except when th...
2011 Apr 05
2
Euclidean Distance in R
Hi 1. I have two raster files *.asc (identical size) 2. The data in each contain presence or absence data in each cell represented by a 1 or 0 respectively 3. I would like to take the location of each 1 (presence cell) in raster file 1 and measure the euclidean distance to the nearest 1 (presence cell) in raster file 2. Obviously in some cases there will be overlap so the distance will be zero. 4. I would like the output file to have each individual measurement on a seperate line in a single file. I am very new to R, so any help would be appreciated....
2008 Oct 06
1
easier way to do this without a loop? (successive euclidean distances between points)
...results[i] <- rdist(z[i,], z[(i+1),]) } results.1 <- data.frame(results) f <- rownames(z) r <- f[-1] rownames(results.1) <- r colnames(results.1) <- f[1] this does what I want it to do - is there an easier/generic way of doing this. I will be using this to calculate euclidean distances between successive time steps on ordination scores. thanks -- Stephen Sefick Research Scientist Southeastern Natural Sciences Academy Let's not spend our time and resources thinking about things that are so little or so large that all they really do for us is puff us up and make us...
2011 Jul 08
1
Visualizing a dissimilarity matrix in Euclidean space
Hi, I have a set of nodes and a dissimilarity matrix for them, as well as a csv file in which the diss matrix has been converted to [node_1, node_2, dissimilarity] format. I would like to visualize this as a graph in Euclidean space (that is, similar nodes clumped together in clusters), rather than the seriation visualization given by dissplot(). I am using Network WorkBench for my visualizations and thus want the R output to be in graphml. If I use, say, graph.data.frame(), it will read the dissimilarity column as an e...
2004 Mar 04
1
boot package
Dear all As part of an ongoing study on the ecomorphology of ant communities, I have obtained a matrix with 156 row (species) and 20 columns (several measurements of body shape) for 4 localities. For each community, I calculated a matrix of Euclidean distances between all pairs of species. From this matrix, I extracted two measures of community structure: i) I identified the distance from a individual to its nearest neighbor (NND) in the morphological space and then calculated the averages of the NND (MNND); ii) the mean of the Euclidean dista...
2018 Mar 15
0
stats 'dist' euclidean distance calculation
> 3x3 subset used > Locus1 Locus2 Locus3 > Samp1 GG <NA> GG > Samp2 AG CA GA > Samp3 AG CA GG > > The euclidean distance function is defined as: sqrt(sum((x_i - y_i)^2)) My > assumption was that the difference between x_i and y_i would be the number > of allelic differences at each base pair site between samples. Base R does not share your assumption, which (from a general purpose stats point of view...
2011 Oct 03
4
distance coefficient for amatrix with ngative valus
Hi, I need to run a PCoA (PCO) for a data set wich has both positive and negative values for variables. I  could not find any distancecoefficient other than euclidean distace running for the data set. Are there any other coefficient works with negtive values.Also I cannot get summary out put (the eigen values) for PCO as for PCA.   Thanks. Dilshan [[alternative HTML version deleted]]
2008 Oct 01
3
for loop question Documentation and its application for calculating euclidean distance on MDS ordination axis scores
...er programing that the documentation is implicit or is R paradigm to discourage the use of the for loop. I will post data probably tonight, but here is my problem. I have preformed an MDS on a set of data. I have the scores of the four axes that are the optimal solution. I want to calculate the euclidean distance between time steps of the ordination. My thought is to use a for loop- calculate distance march to april then calculate the distance from april to may ... Is this the proper way of going about this axis1 axis2 axis3 axis4 march 3 4 6...
2011 Mar 18
3
exploring dist()
Hello, everybody, I hope somebody could help me with a dist() function. I have a data frame of size 2*4087 (col*row), where col corresponds to the treatment and rows are species, values are Hellinger distances, I should reconstruct a distance matrix with a dist() function. I know that "euclidean" method should be used. When I type: dist(dframe,"euclidean") it gives me a truncated table, where values are missing. I suppose that I have to define something for the values, but I have no idea what exactly, because I am not familiar with r at all. I would be very appreciated fo...