Re: [R] Weighted association map

From: Gabor Grothendieck <ggrothendieck_at_gmail.com>
Date: Mon 11 Sep 2006 - 13:18:01 GMT

Great. In looking at it once more I realize that even the sign(kor) part could be shortened to just kor in this example. Regards.

library(sna)
set.seed(123)
kor <- cor(iris[1:4])
gplot(kor, edge.lwd = 10*kor, displaylabels = TRUE, label = rownames(kor))

On 9/11/06, kone <attenka@utu.fi> wrote:
> Sorry to answer so late, but this is just what I want ;-)
>
> -Atte
>
> Gabor Grothendieck kirjoitti 8.9.2006 kello 14.53:
>
> > Actually the discretization does not appear to be needed. This
> > works just as well:
> >
> > set.seed(123)
> > kor <- cor(iris[1:4])
> > gplot(sign(kor), edge.lwd = 10*kor, displaylabels = TRUE, label =
> > rownames(kor))
> >
> > On 9/8/06, Gabor Grothendieck <ggrothendieck@gmail.com> wrote:
> >> Try the sna package. Below we calculate the
> >> correlation matrix, kor, of the numeric cols of builtin iris
> >> dataset. Zap negative ones and discretize rest to
> >> get lwd width matrix, lwd, used for edge widths. From
> >> that create the adjacency matrix, sign(lwd), and plot it
> >> using indicated layout mode. Seems like three of
> >> the variables are correlated and Sepal.Width is uncorrelated
> >> or negatively correlated to those. Try playing around with
> >> gplot args to create variations.
> >>
> >> library(sna)
> >> set.seed(123) # layout uses random numbers
> >> kor <- cor(iris[1:4])
> >> lwd <- replace(kor, TRUE, 10 * round(pmax(0, kor), 1))
> >> gplot(sign(lwd), edge.lwd = lwd, displaylabels = TRUE, label =
> >> rownames(kor))
> >>
> >> On 9/8/06, kone <attenka@utu.fi> wrote:
> >> > Could somebody program this kind of plot type to R, if none exists,
> >> > based on mds or correlation tables or some more suitable method?
> >> What
> >> > do you think about idea? Does it work? None similar or better
> >> exists?
> >> >
> >> > http://weightedassociationmap.blogspot.com/
> >> >
> >> >
> >> > Atte Tenkanen
> >> > University of Turku, Finland
> >> >
> >> > ______________________________________________
> >> > R-help@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.
> >> >
> >>
>
>



R-help@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. Received on Tue Sep 12 04:47:18 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 11 Sep 2006 - 19:30:04 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.