Skip to contents

Produces result summaries.

Usage

# S4 method for AbundanceMatrix
summary(object, ...)

Arguments

object

An AbundanceMatrix object.

...

Currently not used.

Value

An AbundanceSummary object.

See also

Other mutators: mutators, subset()

Author

N. Frerebeau

Examples

## Create a data.frame
X <- matrix(data = sample(0:10, 50, TRUE), nrow = 10, ncol = 5)
Y <- as.data.frame(X)

## Coerce to a count matrix
Z <- as_count(Y)

## Set/get groups
set_samples(Z) <- rep(c("a", "b", "c", "d", "e"), each = 2)
get_samples(Z)
#>  [1] "a" "a" "b" "b" "c" "c" "d" "d" "e" "e"

## Set/get groups
set_groups(Z) <- rep(c("A", "B"), each = 5)
get_groups(Z)
#>  [1] "A" "A" "A" "A" "A" "B" "B" "B" "B" "B"

## Get/get TPQ/TAQ
chrono <- list(
  tpq = sample(1301:1400, 10, replace = TRUE),
  taq = sample(1451:1500, 10, replace = TRUE)
)
set_terminus(Z) <- chrono
get_terminus(Z)
#>        tpq  taq
#> row1  1365 1486
#> row2  1329 1460
#> row3  1316 1465
#> row4  1397 1494
#> row5  1354 1477
#> row6  1312 1491
#> row7  1373 1497
#> row8  1365 1465
#> row9  1326 1488
#> row10 1345 1461

## Collection of features
as_features(Z)
#>       V1 V2 V3 V4 V5 samples group dates  tpq  taq
#> row1   3 10  3  6  4       a     A    NA 1365 1486
#> row2   9  4  1  3  9       a     A    NA 1329 1460
#> row3   4 10  1  3 10       b     A    NA 1316 1465
#> row4   8  5 10  6  8       b     A    NA 1397 1494
#> row5   7  0  8  2  7       c     A    NA 1354 1477
#> row6   1  1  6  0  6       c     B    NA 1312 1491
#> row7   9  5  1  7  9       d     B    NA 1373 1497
#> row8   0  5 10  8  0       d     B    NA 1365 1465
#> row9   4  4  5  3  4       e     B    NA 1326 1488
#> row10  7  3  2  3  7       e     B    NA 1345 1461

## Summarize data
summary(Z)
#> <AbundanceSummary: 10 x 5>
#> A ------------------------------------------------------------------------------
#> * Observations: 5
#> * Variables: 5
#> * Replicated measurements: TRUE
#> * Chronology: 1316 - 1494 (year CE)
#> B ------------------------------------------------------------------------------
#> * Observations: 5
#> * Variables: 5
#> * Replicated measurements: TRUE
#> * Chronology: 1312 - 1497 (year CE)
#> --------------------------------------------------------------------------------