Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

RectDense

Divide a region into rectangles based on density


Description

Given a set of (x,y) points, partition the field into rectangles each containing a minimum number of points

Usage

RectDense(INx, INy, icut = 1, u = par("usr"), ndivs = 10)

Arguments

INx

x-coordinates

INy

y-coordinates

icut

cut off for number of points

u

user coordinates

ndivs

number of divisions in x-coordinate

Details

Based on the user coordinates as returned from par('usr'). Each rectangular region is tested for the number of points that fall within icut or greater.

Value

List:

icorns

matrix of corners that passed test

ilens

vector,number of points in each icorns box

ipass

vector, index of the corners that passed icut

corners

matrix of all corners

lens

vector,number of points for each box

Author(s)

Jonathan M. Lees<jonathan.lees@unc.edu>

Examples

x = rnorm(100)
y = rnorm(100)

plot(x,y)
u = par('usr')
RI = RectDense(x, y, icut=3, u=u, ndivs=10)

 rect(RI$icorns[,1],RI$icorns[,2],RI$icorns[,3],RI$icorns[,4], col=NA, border='blue')

RFOC

Graphics for Spherical Distributions and Earthquake Focal Mechanisms

v3.4-6
GPL (>= 2)
Authors
Jonathan M. Lees [aut, cre], Keehoon Kim [ctb]
Initial release
2018-01-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.