Given a dataframe of x and y values (with some optional confidence intervals surrounding the y values), return only the unique values of x and y in some set of 2-d bins.

round_xy(x, y, cl = NA, cu = NA, roundby = 0.001)

Arguments

x

Numeric vector. The first vector for binning.

y

Numeric vector. the second vector for binning

cl

Numeric vector. Optional confidence interval for the y vector, lower bound.

cu

Numeric vector. Optional confidence interval for the y vector, upper bound.

roundby

Numeric. The amount to round the x and y vectors by for 2d binning.

Value

A dataframe containing the 2-d binned values for x and y, and their confidence intervals.