as.compositional: create a 'compositional' object

View source: R/io.R

as.compositionalR Documentation

create a compositional object

Description

Convert an object of class matrix, data.frame or acomp to an object of class compositional

Usage

as.compositional(x, method = NULL, colmap = "rainbow")

Arguments

x

an object of class matrix, data.frame or acomp

method

dissimilarity measure, either "aitchison" for Aitchison's CLR-distance or "bray" for the Bray-Curtis distance.

colmap

the colour map to be used in pie charts.

Value

an object of class compositional

Examples

data(Namib)
PT.acomp <- as.acomp(Namib$PT)
PT.compositional <- as.compositional(PT.acomp)
print(Namib$PT$x - PT.compositional$x)
## uncomment the following lines for an illustration of using this 
## function to integrate 'provenance' with 'compositions'
# library(compositions)
# data(Glacial)
# a.glac <- acomp(Glacial)
# c.glac <- as.compositional(a.glac)
# summaryplot(c.glac,ncol=8)

provenance documentation built on May 29, 2024, 4:23 a.m.