# data2hist: From real data to distributionH. In HistDAWass: Histogram-Valued Data Analysis

## Description

From real data to distributionH.

## Usage

 ```1 2``` ```data2hist(data, algo = "histogram", type = "combined", qua = 10, breaks = numeric(0), epsilon = 0.01) ```

## Arguments

 `data` a set of numeric values. `algo` (optional) a string. Default is "histogram", i.e. the function "histogram" defined in the `histogram` package. If "base" the `hist` function is used. "FixedQuantiles" computes the histogram using as breaks a fixed number of quantiles. "ManualBreaks" computes a histogram where braks are provided as a vector of values. "PolyLine" computes a histogram using a piecewise linear approximation of the empirical cumulative distribution function using the "Ramer-Douglas-Peucker algorithm", http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm. An `epsilon` parameter is required. The data are scaled in order to have a standard deviation equal to one. `type` (optional) a string. Default is "combined" and generates a histogram having regularly spaced breaks (i.e., equi-width bins) and irregularly spaced ones. The choice is done accordingly with the penalization method described in `histogram`. "regular" returns equi-width binned histograms, "irregular" returns a histogram without equi-width histograms. `qua` a positive integer to provide if `algo="FixedQuantiles"` is chosen. Default=10. `breaks` a vector of values to provide if `algo="ManualBreaks"` is chosen. `epsilon` a number between 0 and 1 to provide if `algo="PolyLine"` is chosen. Default=0.01.

## Value

A `distributionH` object, i.e. a distribution.

`histogram` function

## Examples

 ```1 2 3``` ```data=rnorm(n = 1000,mean = 2,sd = 3) mydist=data2hist(data) plot(mydist) ```

### Example output

```
```

HistDAWass documentation built on March 20, 2018, 5:04 p.m.