isValidBayesSpaceElement: Checks whether an object is an element (or dataset of...

View source: R/classes.R

isValidBayesSpaceElementR Documentation

Checks whether an object is an element (or dataset of elements) of a BayesSpace

Description

May different R objects can be interpreted as elements of a BayesSpace including density functions, histograms, and BData objects.

Usage

isValidBayesSpaceElement(X, basis = NULL)

## S3 method for class ''function''
isValidBayesSpaceElement(X, basis = NULL)

## S3 method for class 'histogram'
isValidBayesSpaceElement(X, basis = NULL)

## S3 method for class 'BData'
isValidBayesSpaceElement(X, basis = NULL)

## Default S3 method:
isValidBayesSpaceElement(X, basis = NULL)

Arguments

X

the element to be checked

basis

an optional BayesSpaceBasis in which it should be an element. If 'basis' is given a TRUE shall only be returned if can be seen as an element of that BayesSpace. That however is not fully implemented yet.

Value

boolean, FALSE if it is definitely not an element of a BayesSpace

Methods (by class)

  • isValidBayesSpaceElement(`function`): functions are valid BayesSpaceElements

  • isValidBayesSpaceElement(histogram): histograms are valid BayesSpaceElements

  • isValidBayesSpaceElement(BData): BData objects contain valid BayesSpaceElements if they are for the same BayesSpace

  • isValidBayesSpaceElement(default): method for samples, tries to check whether the values are in the domain.

Examples

isValidBayesSpaceElement(sin)
isValidBayesSpaceElement(hist(runif(100), plot=FALSE))

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