count2d: Create a matrix of counts.

View source: R/count2d.R

count2dR Documentation

Create a matrix of counts.

Description

Count the number of occurrences of pairs of positive integers in two vectors, producing a matrix.

Usage

count2d(xb, yb, nb)

Arguments

xb

a vector of integers.

yb

a vector of integers.

nb

a vector of length 2 that provides the number of bins for the 2D histogram on x and y.

Details

This function builds a two-dimensional histogram, based on two two vectors of bin numbers (obtained with binit). Rows where x[i] > nb[1] or y[i] > nb[2] are discarded without a warning.

Value

A matrix with nb[1] rows and nb[2] columns with counts. It serves as the input for two-dimensional histogram smoothing.


JOPS documentation built on Sept. 8, 2023, 5:42 p.m.

Related to count2d in JOPS...