scale.BData: Scale and/or center a BData set

scale.BDataR Documentation

Scale and/or center a BData set

Description

Apply scaling and/or centering to a dataset of BData objects. Diverts all calculations to 'mean.BData'-instances as well as to 'msd.BData()' and the arithmetic operations.

Usage

## S3 method for class 'BData'
scale(x, center = TRUE, scale = TRUE, ...)

Arguments

x

data set to transform

center

either logical (default: TRUE) or the mean BData object to subtract from the elements of 'x'

scale

either logical (default: TRUE) or the scalar to divide the (centered?) elements of 'x' with

...

further generic arguments

Value

a data set of the same kind and size of 'x'

Examples

bdl = BDataDensities(list(\(x)(dnorm(x,1,1)),\(x)(dnorm(x,-1,1)) ),basis=B2N01Basis5,closed=TRUE)
bdlsc = scale(bdl)
msd(bdlsc) # should now be 1
mean(bdlsc)[[1]](-5:5) # should be 1 everywhere, i.e. the neutral element

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