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.