[R] How to alter circle size

From: Dat Mai <dat.d.mai_at_gmail.com>
Date: Fri, 06 May 2011 12:51:17 -0400


Hello all,

I'm trying to create a heatmap using 2 matrices I have: z and v. Both matrices represent different correlations for the same independent variables. The problem I have is that I wish to have the values from matrix z to be represented by color intensity while having the values from matrix v to be represented by circle size. I currently have the following in front of me and an unsure of what to add or change in order to achieve that goal.

panel.corrgram.2 =
function(x, y, z, subscripts, at = pretty(z), scale = 0.8, ...) {
  require("grid", quietly = TRUE)

  x <- as.numeric(x)[subscripts]
  y <- as.numeric(y)[subscripts]
  z <- as.numeric(z)[subscripts]

  zcol <- level.colors(z, at = at, ...)
  for (i in seq(along = z))
  {
    lims <- range(0, z[i])
    tval <- 2 * base::pi * seq(from = lims[1], to = lims[2], by = 0.01)     grid.polygon(x = x[i] + .5 * scale * c(0, sin(tval)),
      y = y[i] + .5 * scale * c(0, cos(tval)),
      default.units = "native",
      gp = gpar(fill = zcol[i]))
    grid.circle(x = x[i], y = y[i], r = .5 * scale,
      default.units = "native")

  }
}

k=levelplot(signif(z,3), scales = list(x = list(rot = 45)), col.regions=col.sch, panel = panel.corrgram.2, label = num.circ, xlab="", ylab="", main=paste(output,"receptor response")) print(k)

-- 
Best,
Dat Mai
PhD Rotation Student
Albert Einstein College of Medicine

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org 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 Fri 06 May 2011 - 16:54:14 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 08 May 2011 - 19:10:06 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.

list of date sections of archive