I have some raw data in 2D, x, y as given below. I want to generate a 2D histogram from the data. Typically, dividing the x,y values into bins of size 0.5, and count the number
freq <- as.data.frame(table(findInterval(xy[,1], x.bin),findInterval(xy[,2], y.bin))) freq[,1] <- as.numeric(freq[,1]) freq[,2] <- as.numeric(freq[,2])
This is probably wrong since it destroys the original indices.