| toHistogram | R Documentation |
The function tries to convert anything it gets to a histogram
toHistogram(X, breaks, ..., nsim = NULL, seed = NULL)
## S3 method for class 'numeric'
toHistogram(X, breaks, ..., nsim = NULL, seed = NULL)
## S3 method for class 'histogram'
toHistogram(X, breaks = NULL, ..., nsim = NULL, seed = NULL)
## S3 method for class 'BDataHistograms'
toHistogram(X, breaks, ..., nsim = NULL, seed = NULL)
## S3 method for class 'BDataUnivariateSamples'
toHistogram(X, breaks, ..., nsim = NULL, seed = NULL)
## S3 method for class 'BData'
toHistogram(X, breaks, ..., nsim = NULL, seed = NULL)
X |
the single data representing the histogram. |
breaks |
the breaks of the histogram. Most methods only work if given explicitly. |
... |
further arguments to the [graphics::hist] if called |
nsim |
number of datapoints to be simulated. If null, no simulation will take place. |
seed |
if not null the given seed will be used in case of a simulation and will be added as an attribute to the result (use with care). |
a histogram object, either with or without a counts element, depending on whether count data is availabel (e.g. through simulation.)
toHistogram(numeric): method computing the histogram from a sample
toHistogram(histogram): checks that the breaks fit and returns the
histogram if they do.
toHistogram(BDataHistograms): checks that the breaks of the single
histogram fit and returns the histogram if they do.
toHistogram(BDataUnivariateSamples): computes the histogram with the given
breaks from the dataset.
toHistogram(BData): (not yet implemented) if nsim given,
simulates a dataset from the distribution and computes a
histogram from it, otherwise ...
Other BayesSpaceConverters:
as.BDataDensities(),
as.BDataDensityHistograms(),
as.BDataFrequencyHistograms(),
as.BDataHistograms(),
as.BDataLogDensities(),
as.BDataLogPDFs(),
as.BDataPDFs(),
as.BDataSamples(),
as.BDataSplines(),
idt.BData()
myBreaks = seq(0,1,by=0.2)
toHistogram(runif(100),breaks=myBreaks)
toHistogram(hist(runif(100),plot=FALSE,breaks=myBreaks),breaks=myBreaks)
toHistogram(BDataSamples(list(runif(100)),basis=B2Unif01Basis5),
breaks=myBreaks)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.