ash_1d: Average shifted histogram.

Description Usage Arguments Details Value Examples

Description

Average shifted histogram.

Usage

1
2
ash_1d(x, weight, binwidth, bins=20, m=5, na.rm=FALSE,
    range)

Arguments

x

a numeric vector of positions

weight

NULL or a numeric vector providing weights for each observation

bins

desired number of bins

binwidth

desired bin width (specify this or bins)

na.rm

If TRUE missing values will be silently removed, otherwise they will be removed with a warning.

m

smoothing parameter - this many different starting origins between min(range) and min(range) - binwidth will be generated.

range

range of values to use, if different to range of data.

Details

Computes bins for m evenly spaced origins, then averages the counts over those bins.

Value

A data frame with three columns:

left

the left end of the interval

right

the right end of the interval

count

the number of observations in that interval

Examples

1
2
3
4
5
6
x <- ash_1d(runif(100))
# Simple plot methoded included in package
plot(x)

plot(ash_1d(baseball$b, m = 10))
plot(ash_1d(baseball$b, bins = 100))

hadley/densityvis documentation built on May 17, 2019, 9:56 a.m.