Skip to contents

Conversion functions to dimRedData.

Usage

as.dimRedData(formula, ...)

# S4 method for formula
as.dimRedData(formula, data)

Arguments

formula

The formula, left hand side is assigned to the meta slot right hand side is assigned to the data slot.

...

other arguments.

data

Will be coerced into a data.frame with as.data.frame

Methods (by class)

  • as.dimRedData(formula): Convert a data.frame to a dimRedData object using a formula

See also

Other dimRedData: dimRedData-class

Examples

## create a dimRedData object using a formula
as.dimRedData(Species ~ Sepal.Length + Sepal.Width + Petal.Length + Petal.Width,
              iris)[1:5]
#> An object of class "dimRedData"
#> Slot "data":
#>   Sepal.Length Sepal.Width Petal.Length Petal.Width
#> 1          5.1         3.5          1.4         0.2
#> 2          4.9         3.0          1.4         0.2
#> 3          4.7         3.2          1.3         0.2
#> 4          4.6         3.1          1.5         0.2
#> 5          5.0         3.6          1.4         0.2
#> 
#> Slot "meta":
#>   Species
#> 1  setosa
#> 2  setosa
#> 3  setosa
#> 4  setosa
#> 5  setosa
#>