Skip to content

2D fellows

3 messages · TRAN Liem FTM/Men, Winfried Theis

#
Hello everybody,


I would like to perform some treatments on a group. Each element of my
group is a 2D array. They all have the same dimensions.

I would like to know if I can find in R some functions like "dist" (base
package), "hclust" and "kmeans" (mva package) but in order to use 2D
arrays more than vectors. 

Maybe my question doesn't have sense for the R context but it would be
really great for my job :-)

Many thank in advance for any help

Li?m TRAN
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Dear Liem!
On 15-May-00 TRAN Liem FTM/Men wrote:
I don't know what you mean exactly by a "2D-array", I would think first of
something you could easily convert to a matrix, or a data frame! (I just had a
look on "Notes on R" and the description of arrays there confirms my belief
about the convertion.)
Well, if you could convert your arrays into vectors (via matrix or data frame
 if you want to) and collect them in a data frame you could use these functions.
If you need a special distance you could program a function in which you compute
the pairwise distances and write them to a dissimilarity matrix as in the
package cluster. For a description see the documentation there (or just type
daisy after loading the package cluster). With this you could use the functions
diana for divisive hierarchical
clustering, agnes for agglomerative nesting or for k-means pam. 

I hope this helps,

yours Winfried Theis
----------------------------------
E-Mail: Winfried Theis <theis at statistik.uni-dortmund.de>
Date: 16-May-00
Tel.: +49-231-755-5903                  Room: Mathematikgebäude, M832
Dipl.-Math. Winfried Theis, Graduiertenkolleg "Angewandte Statistik",
Universität Dortmund, 44221 Dortmund
----------------------------------
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
Hello Winfried
Indeed, my objects can be considered as matrix or data frame
It would give me (for example with "dist") the (relative) distances
between
my collection of rows. 

My problem (I realize I wasn't precise enough) is to calulate, for
example, the distance between two matrices and not between two rows. 

If I consider 2 matrices A and B with N rows each (and M columns), I
could use dist on each pair of rows (one for A, one for B), and compute
N time "dist" on 2 x M matrices. 

And I could after calculate a distance with the N distances but I find
it a bit heavy, and I don't know how to
perform an object which would be usable as input for, let's say,
"hclust".
That is typically my problem with R: How can I write the right object
like a dissimilarity matrix if I need one?
I'm not used enough with the "statistical" objects and not used enough
with R to succeed writing directly the objects in the right "R-shape".
That's why I would like to find already "R-shaped" objects.
I just installed the cluster package among others. I hope to find what
I'm looking for. 
Otherwise, I'll be back ;-)
It does. Many thanks

Li?m
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._