Learn R Programming

nexus (version 0.3.0)

t: Matrix Transpose

Description

Matrix Transpose

Usage

# S4 method for CompositionMatrix
t(x)

# S4 method for LogRatio t(x)

Value

A matrix, with dim and dimnames constructed appropriately from those of x.

Arguments

x

A CompositionMatrix object.

Author

N. Frerebeau

Examples

Run this code
## Data from Aitchison 1986
data("hongite")

## Coerce to compositional data
coda <- as_composition(hongite)
head(coda)

## Subset
coda[[1, 1]] # Get the first value
coda[1] # Get the first value
coda[, ] # Get all values
coda[1, ] # Get the first row

## Subcomposition
subcoda <- coda[, 1:3] # Get the first three column
head(subcoda)

Run the code above in your browser using DataLab