Something like

> library(hexbin)
> set.seed(42)
> xy <- matrix(rnorm(1000), 500)
> xy.hex <- hexbin(xy)
> table(xy.hex@count)

  1   2   3   4   5   6   7   8 
159  60  33  16   6   1   2   1 
> sum(xy.hex@count >= 3)
[1] 59

-------------------------------------
David L Carlson
Department of Anthropology
Texas A&M University
College Station, TX 77840-4352

-----Original Message-----
From: R-help [mailto:r-help-boun...@r-project.org] On Behalf Of Sidoti, 
Salvatore A.
Sent: Monday, December 14, 2015 6:49 PM
To: r-help@r-project.org
Subject: [R] Hexbin: Counting Bins That Meet Certain Criteria

Greetings!

Is there a way to count the bins in a hexbin plot that meet certain criteria? 
For instance, what if I wanted to count the bins (hexes) that have a datapoint 
density of some number x?

Thank you!

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to