as_features {nexus}R Documentation

Coerce to Features

Description

Converts an object to a collection of features.

Usage

as_features(from, ...)

## S4 method for signature 'CompositionMatrix'
as_features(from)

Arguments

from

A CompositionMatrix object.

...

Currently not used.

Value

A data.frame with all informations as extra columns.

Author(s)

N. Frerebeau

See Also

Other compositional data tools: as_amounts(), as_composition()

Examples

## Create a count matrix
A1 <- matrix(data = as.numeric(sample(1:100, 100, TRUE)), nrow = 20)

## Coerce to compositions
B <- as_composition(A1)

## Row sums are internally stored before coercing to relative frequencies
get_totals(B)

## This allows to restore the source data
A2 <- as_amounts(B)

## Coerce to a data.frame
X <- data.frame(B)
head(X)

[Package nexus version 0.2.0 Index]