[R] Heatmap - strange horizontal lines

Jeff Newmiller jdnewmil at dcn.davis.CA.us
Fri Oct 24 18:51:20 CEST 2014


I don't use these functions often enough to know their idiosyncrasies, but they appear to treat zero like a NA, and your second file has lots of zeros. I suspect this is due to the default way the continuous act data are 'cut" excluding the left side of the bins. If you read the help files you may find a way to change this or you could cut it to a factor yourself and give the factor to be plotted instead of the continuous variable.
---------------------------------------------------------------------------
Jeff Newmiller                        The     .....       .....  Go Live...
DCN:<jdnewmil at dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live Go...
                                      Live:   OO#.. Dead: OO#..  Playing
Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
/Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
--------------------------------------------------------------------------- 
Sent from my phone. Please excuse my brevity.

On October 23, 2014 11:45:54 AM PDT, zuzana zajkova <zuzulaz at gmail.com> wrote:
>Dear list,
>
>I would like to make heatmaps from my data. Acctualy, I have already
>done
>it, but the issue it that is doesn't work well for all files.
>
>All files have the same structure, after importing them I do few
>calculations using the same script, to obtain variables for plotting.
>
>You can find the files here, the pb2166 is the one which works fine and
>I
>get normal (expected) heatmap plot, the pb2214 it the other type, for
>which
>I obtain strange horizontal lines...
>
>https://www.dropbox.com/s/rz2ywnloepvr3d8/pb2166.csv?dl=0
>https://www.dropbox.com/s/42taaybtbortv0p/pb2214.csv?dl=0
>
>The structure of data is this (the same, from my point of view...):
>
>str(pb2166)
>'data.frame':  55119 obs. of  3 variables:
> $ dtime: num  17.9 18.1 18.3 18.4 18.6 ...
> $ act  : int  9 1 0 0 0 0 0 0 0 0 ...
> $ jul  : num  13573 13573 13573 13573 13573 ...
>
>str(pb2214)
>'data.frame':  44707 obs. of  3 variables:
> $ dtime: num  17.9 18.1 18.2 18.4 18.6 ...
> $ act  : int  9 1 0 0 0 0 0 0 0 0 ...
> $ jul  : num  13573 13573 13573 13573 13573 ...
>
>
>To  create a heatmap I tried ggplot/qlot and levelplot aswell, the
>results
>are the same... for pb2166 works ok, for pb2214 doesn't...
>
>qplot(jul, dtime, data=pb2166, geom="tile", fill=act) +
>scale_fill_gradient(low="gold", high="green4")
>levelplot(act ~ jul * dtime, pb2166 )
>
>qplot(jul, dtime, data=pb2214, geom="tile", fill=act) +
>scale_fill_gradient(low="gold", high="green4")
>levelplot(act ~ jul * dtime, pb2214 )
>
>I would be very thankful if somebody could take a look on the data and
>find
>something what I am missing.
>
>Kind regards,
>
>Zuzana
>
>	[[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.



More information about the R-help mailing list