as.BDataHistograms: Represent data as a BDataHistogram (BDataDensityHistogram or...

View source: R/converters.R

as.BDataHistogramsR Documentation

Represent data as a BDataHistogram (BDataDensityHistogram or BDataFrequencyHistogram

Description

The function tries to guess whether its datasets, distributions, Histograms,...

Usage

as.BDataHistograms(X, ...)

## S3 method for class 'list'
as.BDataHistograms(
  X,
  ...,
  breaks = NULL,
  basis = NULL,
  nsim = NULL,
  seed = NULL
)

## S3 method for class 'BDataHistograms'
as.BDataHistograms(
  X,
  ...,
  breaks = NULL,
  basis = NULL,
  nsim = NULL,
  seed = NULL
)

## S3 method for class 'histogram'
as.BDataHistograms(X, ..., breaks = NULL, basis, nsim = NULL, seed = NULL)

## S3 method for class 'BDataFrequencyHistograms'
as.BDataHistograms(X, ...)

## S3 method for class 'BDataDensityHistograms'
as.BDataHistograms(X, ...)

Arguments

X

a list of objects (or single object) that is a numeric sample, a histogram (with or without a counts), or a BData object

...

further arguments to [graphics::hist]

breaks

the common breaks. If the data is provided as histograms it should already be provide with these breaks

basis

the BayesSpaceBasis to be used in the resulting BayesSpace, if required

nsim

the number of points to simulate if the data is provided as a distribution. If NULL no simulation is done.

seed

the seed to used if data is simulated (use with care)

Value

either a BDataFrequencyHistograms (if counts are availalbe) , or a BDataDensityHistograms object if only densities are known

Methods (by class)

  • as.BDataHistograms(list): method for lists of possibly heterogenious data

  • as.BDataHistograms(BDataHistograms): checks breaks if given

  • as.BDataHistograms(histogram): checks breaks if given

  • as.BDataHistograms(BDataFrequencyHistograms): identity converter

  • as.BDataHistograms(BDataDensityHistograms): identity converter

See Also

Other BayesSpaceConverters: as.BDataDensities(), as.BDataDensityHistograms(), as.BDataFrequencyHistograms(), as.BDataLogDensities(), as.BDataLogPDFs(), as.BDataPDFs(), as.BDataSamples(), as.BDataSplines(), idt.BData(), toHistogram()

Examples

myBreaks = seq(0,1,by=0.2)
as.BDataHistograms(replicate(10,runif(100),simplify=FALSE),
                   breaks=myBreaks,basis=B2Unif01Basis5)


DistributionalDDA documentation built on Oct. 20, 2026, 5:06 p.m.