0

How can I visualize overlapping values among two datasets in R. Preferably, I like to use a Hexbinplot (http://www.everydayanalytics.ca/2014/09/5-ways-to-do-2d-histograms-in-r.html)

Here I have a dataset with two variables.

Variable A: http://pastebin.com/0ayrgU9C

Variable B: http://pastebin.com/9WZQWXsA

In R you can load the data via

data1 <- read.table("http://pastebin.com/raw.php?i=0ayrgU9C", header=TRUE)
data2 <- read.table("http://pastebin.com/raw.php?i=9WZQWXsA", header=TRUE)

The values in the variables reach from 0.1 to a max of 1.0. The two sets have a different size (row length). Now, how can I visualize in which area the two sets overlap?

It should be red where the most values appear in both datasets. I assume that equal bins have to be created in order to do see overlapping within certain ranges, but I'm not sure how to do this either. I know that a Kernel Density histogram is an alternative but I want to find out how a Hexbinplot can solve it, too.

Would be great to see a solution with the provided dataset.

user20650
  • 24,654
  • 5
  • 56
  • 91
JohnnyDeer
  • 231
  • 4
  • 14
  • 2
    Anything you already tried yourself? Why did it not work? – Heroka Jan 10 '16 at 15:56
  • 1
    Your data-sets appear to be one-dimensionsional. I can not imagine how hexbinplots can be used for one dimensional data. – CAFEBABE Jan 10 '16 at 16:07
  • I agree that this argument is true. Even if two items overlap, one can still not know which variable makes the contribution. Any other idea which kind of plot can be used to visualize overlapping? – JohnnyDeer Jan 10 '16 at 18:32

0 Answers0