Displaying 20 results from an estimated 100 matches similar to: "gdist and gower distance"
2006 Mar 08
1
function gdist, dist and vegdist in mvpart
Dear R community,
I am analyzing plant communities with the function mvpart, using a
dissimilarit matrix as input. The matrix is calculated with the funtion
gdist.
fit <- mvpart(gdist (ba12[,18:29], meth="maximum", full=TRUE,
sq=F) ~ beers + slope_dem + elev_dem+ plc_dem + pr_curv+
+curv+max_depth+doc_rocks+ abandon+land_use+ca_old,
data=ba12, xv="p")
This
2006 Nov 17
3
gower distance calculation
Hello
I have 2 rows in a matrix and I want to calculate the Gower Distance between
the 2 , how can I do it?
I searched and found nothing that can help me, and my program doesn't know
the gdist function and I couldn't find it on the R help site.
Can anyone help me plz
Thank u all
[[alternative HTML version deleted]]
2010 Feb 26
2
Error in mvpart example
Dear all,
I'm getting an error in one of the stock examples in the 'mvpart' package. I tried:
require(mvpart)
data(spider)
fit3 <- rpart(gdist(spider[,1:12],meth="bray",full=TRUE,sq=TRUE)~water+twigs+reft+herbs+moss+sand,spider,method="dist") #directly from ?rpart
summary(fit3)
...which returned the following:
Error in apply(formatg(yval, digits - 3), 1,
2010 Apr 16
2
managing data and removing lines
Hi,
I am very new to R and I've been trying to work through the R book to gain a
better idea of the code (which is also completely new to me).
Initially I imputed my data from a text file and that seemed to work ok, but
I'm trying to examine linear relationships between gdist and gair, gdist and
gsub, m6dist and m6air, etc.
This didn't work and I think it might have something to do
2006 Aug 13
1
Gower Similarity Coefficient
I'm interested in clustering my data using the Gower Similarity Coefficient,
and I was wondering if R is capable of using that metric
Timothy Rye
[[alternative HTML version deleted]]
2005 Aug 12
6
evaluating string variables
Hello!!!
I have a folder (C:/R/) with matrix files, named by number, i.e.
0.mat, 1.mat,...,1250.mat. In this case, they are 5x5 simetric
matrices. I would like to compute a property for each matrix and put
calculated values into a data frame for posterior ploting and
printing. Below there is an example for 7 matrices (0.mat..6.mat)
#define data frame
L <- data.frame(frame=numeric(7),
2012 Jun 20
1
prcomp: where do sdev values come from?
In the manual page for prcomp(), it says that sdev is "the standard
deviations of the principal components (i.e., the square roots of the
eigenvalues of the covariance/correlation matrix, though the
calculation is actually done with the singular values of the data
matrix)." ?However, this is not what I'm finding. ?The values appear
to be the standard deviations of a reprojection of
2003 May 31
3
function to populate a matrix based on a lookup to another matrix ?
Hi,
This is a beginner R question.
I have a 4x4 matrix named 'lookup' with the following values:
1 2 3 4
1 0.000000 2.828427 5.656854 8.485281
2 2.828427 0.000000 2.828427 5.656854
3 5.656854 2.828427 0.000000 2.828427
4 8.485281 5.656854 2.828427 0.000000
I then create a new empty matrix named 'dd' with specfic row and col names :
2010 Nov 19
2
Calculating distance between longitude,latitude of 2 points
Hi all,
I would like to know a way of calculating the distance between 2 points when
I already have the longitude and latitude of the points.
For example :
Point 1 : 52? 9'54.00"N 4?25'8.40"E
Point 2 : 52?27'46.80"N 4?33'18.00"E
Distance between point 1 and point in km ....
Is there any functions already available for this ?
Any help will be much
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]]
2011 Sep 25
4
Trouble creating and adjacency matrix
Hello all,
I'm having trouble creating an adjacency matrix.
Basically, I need to turn the following distance matrix into an adjacency
matrix based on whether values are >1.5 or not. If they are >1.5, then the
returned value should be 0. If they are =<1.5, then the returned value
should be 1.
DistanceMatrix:
A B C D E
[1,]
2001 May 16
2
Strange formatting
I've never noticed this before, though it's probably not new. In
1.2.3 for Windows, if I print a short vector the formatting is
different than if I print a long one, whether or not they fit on one
line. The short/long split appears to be between 9 and 10 elements:
> 1:9
[1] 1 2 3 4 5 6 7 8 9
> 1:10
[1] 1 2 3 4 5 6 7 8 9 10
> sqrt(1:9)
[1] 1.000000 1.414214
2011 Sep 26
3
Nearest neighbour in a matrix
Hello all,
I am brand new to R and doing an exercise for a class. I need to find the
nearest neighbour for points in the following matrix:
> DistanceMatrix
x1 x2 x3 x4 x5
[1,] 0.000000 2.828427 1.581139 2.236068 2.000000
[2,] 2.828427 0.000000 1.581139 4.123106 2.000000
[3,] 1.581139 1.581139 0.000000 2.549510 2.121320
[4,] 2.236068 4.123106 2.549510
1999 Mar 22
0
Extension to outer()
This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.
---559023410-1804928587-922106403=:691
Content-Type: TEXT/PLAIN; charset=US-ASCII
A couple of weeks ago I asked if anyone had generalised outer to include
bound extents -- effectively
2012 Mar 01
0
Memory problem in R
Hi all, I am running an -MNP- multinomial probit model package using R. It gives me the following objection instead of giving me the results:
Erreur : impossible d'allouer un vecteur de taille 137.9 Mo (in english: cannot allocate a 137.9 Mb vector memory).
I have already increased the memory size upto 2047Mb. This problem has been discussed in 2008 (archives) but no profitable answers were
2007 Oct 16
2
Canberra distance
Hi,
I misunderstand the definition of Canberra distance in R.
On Internet and in function description pages of dist() from stats and
Dist() from amap, Canberra distance between vectors x and y, d(x,y), is :
d(x,y) = sum(abs(x-y)/(x+y))
But in use, through simple examples, we find that the formula is :
d(x,y) = (NZ + 1)/NZ * sum(abs(x-y)/(x+y))
with NZ = nb of pairs of coordinates that are
2006 Feb 20
2
Matrix / SparseM conflict (PR#8618)
Full_Name: David Pleydell
Version: 2.2.1
OS: Debian Etch
Submission from: (NULL) (193.55.70.206)
There appears to be a conflict between the chol functions from the Matrix and
the SparseM packages. chol() can only be applied to a matrix of class dspMatrix
if SparseM is not in the path.
with gratitude
David
> library(Matrix)
> sm <- as(as(Matrix(diag(5) + 1), "dsyMatrix"),
2008 Oct 13
1
Gower distance between a individual and a population
Hi the list,
I need to compute Gower distance between a specific individual and all
the other individual.
The function DAISY from package cluster compute all the pairwise
dissimilarities of a population. If the population is N individuals,
that is arround N^2 distances to compute.
I need to compute the distance between a specific individual and all
the other individual, that is only N
2012 Oct 15
1
weighting variables using Gower with DAISY
Hello,
I am running DAISY in R and using the GOWER metric since I am working with
mixed variables. I am wondering if there is a way to weight the different
variables. I see that there is a weight value for Gower but do not know if
this is how to weight the diffrent variables with different weighting
values. Please advise if there is a way to weight the different variables.
Thank you.
--
View
2012 Oct 18
0
want to count 2 NULLS as disimilar with DIANA/DAISY/GOWER
I am using DIANA/DAISY/GOWER. Some of my categorical data include NULLS.
When assessing disimilarity, these NULLS are considered similar. I do not
want these NULLS to contribute towards similarity. Instead is there a way
for these NULLS to each be considered different so as to contribute to
disimiliarity and not simillarity? Also, I do not want to change these NULLS
in the data as I need them for