similar to: euclidean dist. between matrices

Displaying 20 results from an estimated 5000 matches similar to: "euclidean dist. between matrices"

2012 Nov 14
3
reversing distance matrix for original values
dear useRs, i created a distance matrix, of certain voltage values. unfortunately, i lost the original values. i am only left with the distance matrix that i created from those values. i wanted to ask that is there a way in R to reverse distance matrix for the original values? thanks in advance eliza [[alternative HTML version deleted]]
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
2013 Jan 02
4
list of matrices
dear useRs, i have a list containing 16 matrices. i want to calculate the column mean of each of them. i tried >sr <- lapply(s,function(x) colMeans(x, na.rm=TRUE)) but i am getting the following error >Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric can it be done in any other way? and why i am getting this error?? thanks in advance.. elisa [[alternative
2013 Dec 12
2
method default for hclust function
I could not figure out what was the default when I ran hclust() without specifying the method. For example: I just have a code like: hclust(dist(data)) Any input would be appreciated:) [[alternative HTML version deleted]]
2013 Jan 03
5
splitting matrices
Dear useRs, i want to split a matrix having 1116rows and 12 columns. i want to split that matrix into 36 small matrices each having 12 columns and 31 rows. The big matrix should be splitted row wise. which means that the first small matrix should copy values which are in first 31 rows and 12 columns of the big matrix. similarly 2nd small matrix should contain values from 32nd to 63rd row of the
2012 Nov 27
3
loop command to matrix
Dear UseRs,Extremely sorry for a basic question. I have a matrix of 19 rows and 365 columns. what i want to do is the following...First i want to leave out column number 1 and want to calculate the row wise mean of the remaining columns, which will obviously give me 365 values in one column, and then subtracting these values from the column i left out i.e. col=1 then i want to leave out column 2
2012 Oct 05
3
loop for column substraction of a matrix
Dear useRs, I have a matrix with 38 columns and 365 rows. what i want to do is the following..... 1. subtracting from each column, first itself and then all the remaining columns. More precisely, from column number 1, i will first subtract itself(column 1) and then the remaining 37 columns. Afterwards i will take column number 2 and do the same. In this way i want to proceed till 38th column.
2012 Sep 21
2
efficient overlapping average curve on original curves
Dear useRs, my question could be very basic for which i apologize in advance. Each column of a matrix with dimensions 365 rows and 37 columns was drawn against another matrix of dimensions 365 rows and 1 column. with that i was able to draw 37 curves on the same axis. now i want to draw an average curve of these 37 curves on the same axis in such a way that all the curves (average and 37
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
2012 Oct 15
2
median between matrix column
Dear useRs, 1. how to calculate single median value for two columns of a matrix? 2. i have a matrix of 16 columns and 365 rows, how to calculate median between columns 1 and 16, 2 and 16, 3 and 16, 4 and 16, 5 and 16 till 15th column. is there a loop command to do the said operation? regards eliza [[alternative HTML version deleted]]
2013 Apr 25
2
connecting matrices
Dear Elisa, Try this: el<- matrix(1:100,ncol=20) ?set.seed(25) ?el1<- matrix(sample(1:100,20,replace=TRUE),ncol=1) In the example you showed, there were no column names.? ?list(el[,sort(el1)[1:3]],sort(el1,index.return=TRUE)$ix[1:3]) #[[1]] ?# ?? [,1] [,2] [,3] #[1,]?? 31?? 61?? 71 #[2,]?? 32?? 62?? 72 #[3,]?? 33?? 63?? 73 #[4,]?? 34?? 64?? 74 #[5,]?? 35?? 65?? 75 # #[[2]] #[1] 9 5 3 A.K.
2013 Feb 13
3
date and matrices
Hi Elisa, Try this: date1<-format(seq.Date(as.Date("1991.1.1",format="%Y.%m.%d"),as.Date("1996.12.31",format="%Y.%m.%d"),by="day"),"%Y.%m.%d") ?length(date1) #[1] 2192 mat1<-matrix(c(.314,.314,.273,.273,.236,.236,.236,.236,.273,.314,.403,.314),ncol=1) res1<-
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
2013 Apr 24
2
Distance matrices Combinations
Dear UseRs, MY PROBLEM IS A SMALL PIECE OF A REAL BIG AND A COMPLICATED PROBLEM. IF I DELIBERATE IN A VERY SIMPLE WAY THEN ALL I WANT IS TO PUT ALL THE POSSIBLE COMBINATIONS OF 75 DISTANCE MATRICES (BY TAKING 4 MATRICES, MORE COMMONLY 75C4), in the following equation. t<-as.matrix((MAT1)^2+(MAT2)^2+(MAT3)^2+(MAT4)^2+,upper=T,diag=T)) Then "1215450" values of "t"(one for
2013 Jan 10
1
merging command
HI Eliza, You could do this: set.seed(15) mat1<-matrix(sample(1:800,124*12,replace=TRUE),nrow=12) # smaller dataset #Your codes ?list1<-list() ?for(i in 1:ncol(mat1)){ ? list1[[i]]<-t(apply(mat1,1,function(x) x[i]-x)) ? list1} ?x<-list1?? x<-matrix(unlist(x),nrow=12) x<-abs(x) ?y<-colSums(x, na.rm=FALSE) z<-matrix(y,ncol=10) ?z<-as.dist(z) ?z ?# ?? 1?? 2?? 3?? 4?? 5??
2013 Apr 06
1
list of distance matrices
Dear UseRs, i want to apply mantel test by comparing a list of 124 distance matrices with a reference distance matrix "q". The list of distance matrices was created by the following command.. u<-lapply(el, function(x) dist(x)) where "el" is a data frame of 75 columns and 124 rows. Therefore, the list of distances matrices, made out of it should have 75 elements each
2013 Feb 17
6
histogram
HI Elisa, You could use ?cut() vec1<-c(33,18,13,47,30,10,6,21,39,25,40,29,14,16,44,1,41,4,15,20,46,32,38,5,31,12,48,27,36,24,34,2,35,11,42,9,8,7,26,22,43,17,19,28,23,3,49,37,50,45) label1<-unlist(lapply(mapply(c,lapply(seq(0,45,5),function(x) x),lapply(seq(5,50,5),function(x) x),SIMPLIFY=FALSE),function(i) paste(i[1],"<x<=",i[2],sep="")))
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 abundance whereas others are in high abundance,
2012 Aug 24
3
Euclidean distance function
Hi, I should preface this problem with a statement that although I am sure this is a really easy function to write, I have tried and failed to get my head around writing functions in R. I can use R where 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
2012 Sep 20
1
fourier series for finding average values
Dear UseRs, i have a matrix of 365 rows and 444 columns. i drew each column of this matrix against the number of days in a year, which are obviously 365. now i have 444 curves and i want to Use Fourier analysis for the approximation of the average values. does anyone know how to do it? any help in this regards will be deeply appreciated... regards eliza [[alternative HTML version