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  1312 1477
#> row2  1389 1467
#> row3  1394 1478
#> row4  1346 1456
#> row5  1377 1471
#> row6  1367 1458
#> row7  1356 1470
#> row8  1352 1455
#> row9  1369 1495
#> row10 1315 1468

## Collection of features
as_features(Z)
#>       V1 V2 V3 V4 V5 samples group dates  tpq  taq
#> row1   3  8  5  0  6       a     A    NA 1312 1477
#> row2   9  2  9  5  1       a     A    NA 1389 1467
#> row3   9  1  4  2 10       b     A    NA 1394 1478
#> row4   4  0  3  2 10       b     A    NA 1346 1456
#> row5  10 10  8  8  4       c     A    NA 1377 1471
#> row6   7  3  8  7  9       c     B    NA 1367 1458
#> row7   1  1  2  0  5       d     B    NA 1356 1470
#> row8   8  3  3  8  0       d     B    NA 1352 1455
#> row9  10  9 10  0  9       e     B    NA 1369 1495
#> row10  7  2  6  3  3       e     B    NA 1315 1468

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