Learn R Programming

scidb (version 1.1-2)

hist-methods: Methods for Function hist in Package scidb

Description

The generic function 'hist' computes a histogram of the given data values. If 'plot = TRUE', the resulting object of class histogram is plotted by plot.histogram, before it is returned.

Usage

## S3 method for class 'scidb':
hist(x, breaks=10, right=FALSE, materialize=TRUE, `eval`=FALSE, `plot`=TRUE, ...)
## S3 method for class 'scidbdf':
hist(x, breaks=10, right=FALSE, materialize=TRUE, `eval`=FALSE, `plot`=TRUE, ...)

Arguments

x
A scidb or scidbdf object.
breaks
a single number giving the number of cells for the histogram.
right
logical; if TRUE, the histogram cells are right-closed (left open) intervals.
materialize
logical; if TRUE, the histogram results are materialized into R vectors and returned as a standard object of class histogram. Otherwise the results are returned as SciDB objects.
eval
Optional, logical; If TRUE, execute the query and store the reult array. Otherwise defer evaluation.
plot
Optional, logical; If TRUE, plot result before returning.
...
Optional; additional arguments for plotting.

Value

  • A histogram object, which is a list of components:

    • breaks: the n+1 cell boundaries.
    • counts: n integers; for each cell, the number ofx[]inside.
    • density: estimated density values.
    • mids: the n cell midpoints.

Details

This histogram function only supports equidistant breaks. If 'right = TRUE' (default), the histogram cells are intervals of the form '(a, b]', i.e., they include their right-hand endpoint, but not their left one.