[R] Distance function
Gavin Simpson
gavin.simpson at ucl.ac.uk
Thu Jun 21 20:22:35 CEST 2007
On Thu, 2007-06-21 at 19:56 +0200, Birgit Lemcke wrote:
> Hello you all from the R Help mailing list!
>
> I am working on a PowerBook with Mac Os X and use R 2.5.0.
> I used the distance function from the analogue package to perform a
> similarity analysis using the Gowers Index and weighted Variables.
> My variables are bivariate data and measurements as well as interval
> data transformed into minimum and maximum variables.
> I used this Code:
>
> Dist.Gowa<-distance(Table1a ,Table0a ,method ="mixed", weights
^^^^^^^^
>
> (weighting),R = NULL )
^^^^^^^^^^^
Something is not right there (^^^^) is this exactly what you typed?
You should not send questions about contributed packages to the list ---
as detailed in the posting guide. Without seeing Table1a and Table0a, it
is hard to say why this is failing - I suspect something about the
structure of the two data frames is throwing the function off.
If you can, send me that data ***off-list*** and I will take a look for
you, but as I'm teaching all day tomorrow, it won't happen till after
the weekend now.
HTH
G
>
>
> weighting is a vector created by this code:
>
> (weighting<- c
> (1/3,1/3,1/3,1/2,1/2,1/2,1/2,1/2,1/2,1/4,1/4,1/4,1/4,1/7,1/7,1/7,1/7,1/7
> ,
> 1/7,1/7,1/3,1/3,1/3,1/5,1/5,1/5,1/5,1/5,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,
> 1/9,1/5,1/5,1/5,1/5,1/5,1/7,1/7,1/7,1/7,1/7,1/7,1/7,1/7,1/7,1/7,1/7,1/7,
> 1/7,1/7,1/5,1/5,1/5,1/5,1/5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
> 1,1))
> It contains the weightings for the variables of the two data tables.
>
> My data tables look like this:
>
>
> Anth_cap1 8.0 NA NA 4.0 5.0 1 1 3.0 5.0 2.4 4.5 5
> 5 2 2 2 3 1 1 1 1
> Anth_crin1 5.0 NA NA 3.5 11.0 1 1 3.0 10.0 2.0 4.5 3
> 4 2 2 3 3 1 1 2 3
> Anth_eck1 7.0 NA NA 6.0 12.0 1 1 6.0 11.0 2.0 3.0 3
> 5 2 2 3 3 1 1 1 2
>
> At the end of the analysis I get always this message:
>
> 1: $ operator is deprecated for atomic vectors, returning NULL in:
> object$na.action
> 2: $ operator is deprecated for atomic vectors, returning NULL in:
> object$weights
>
> Can anybody explain me what this means?
>
> Does anybody know if I have to standardize my measurements. As I
> understood this is included in Gowers Index. If not is there a
> function with different options of standardization more than rescaler
> from the reshape package provides?
>
> Thanks for your help in advance.
>
> Greetings
>
> Birgit
>
> Birgit Lemcke
> Institut fr Systematische Botanik
> Zollikerstrasse 107
> CH-8008 Zrich
> Switzerland
> Ph: +41 (0)44 634 8351
> birgit.lemcke at systbot.uzh.ch
>
>
>
>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
Gavin Simpson [t] +44 (0)20 7679 0522
ECRC, UCL Geography, [f] +44 (0)20 7679 0565
Pearson Building, [e] gavin.simpsonATNOSPAMucl.ac.uk
Gower Street, London [w] http://www.ucl.ac.uk/~ucfagls/
UK. WC1E 6BT. [w] http://www.freshwaters.org.uk
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
More information about the R-help
mailing list