[R] ggplot2/heat map/duplicated level problem

Kate Ignatius kate.ignatius at gmail.com
Sun Aug 17 18:32:02 CEST 2014


I hope I can explain my problem clearly....

I have a plink output file that I want to graph a heat map of the
PI_HAT estimates.  I have the following code that I has worked in the
past but this time I'm getting the error:

In `levels<-`(`*tmp*`, value = if (nl == nL) as.character(labels) else
paste0(labels,  :
  duplicated levels in factors are deprecated

My code:


image = (p <- ggplot(db, aes(IID1, IID2)) +
   geom_tile(aes(fill = PI_HAT), colour = "white") +
   scale_fill_gradient2(low = "blue", high = "red") +
   labs(x = "Individual 1",y = "Individual 2")
   opts(axis.text.x = theme_text(angle=90)) +
   opts(title="",legend.position = "right"))

I'm trying to figure out whether this is a problem with duplicated
PI-HAT estimates or duplicated ID pairings (though the latter
shouldn't be the case as I've used similar files in the past).

What else could be the problem?

P.S.  My file is quite large (300K lines) so its pretty hard to
decipher the problem off the bat but the usual plink output file for
this type of file has the heading:

    FID1       IID1    FID2       IID2 RT    EZ      Z0      Z1      Z2  PI_HAT

More information about the R-help mailing list