head: Return the First or Last Part of the Species Matrix

Description Usage Arguments Value Methods Note Author(s) See Also Examples

Description

Returns the first or last parts of the species matrix.

Usage

1
2
3
4
5
6
  ## S4 method for signature 'Vegsoup'
head(x, n = 6L, choice, typeof, ...)
  ## S4 method for signature 'VegsoupPartition'
head(x, n = 6L, choice, typeof, ...)
  ## S4 method for signature 'Vegsoup'
tail(x, n = 6L, choice, typeof, ...)

Arguments

x

An object inheriting from class Vegsoup.

n

A single integer. If positive, size for the resulting object. If negative, all but the n last/first number of elements of x. defaults to n = 6L.

choice

Display the first rows of the species matrix ("species", the default), or the sites data frame (choice = "sites").

typeof

If choice is “species” of which mode should the returned matrix be reported (see as.matrix). If missing a presence/absence species matrix is printed (typeof = "logical").

...

Passed to functions.

Value

An object like as.matrix(x) but generally smaller.

Methods

signature(obj = "Vegsoup")

head() (tail()) returns the first (last) n rows of the community matrix when choice = "species" and the n rows of the sites data frame.

signature(obj = "VegsoupPartition")

If n != 6L the method prints the typal (typal) sample for each partition, with the number of rows equaling getK(x). If n is left as the default the behaviour is the same as defined for class Vegsoup.

Note

Call the method with named arguments ('choice' respectively 'typeof'). See ‘Examples’.

Author(s)

Roland Kaiser

See Also

as.matrix and typal in package vegsoup

head and tail in package utils.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
require(vegsoup)

data(windsfeld)
x <- windsfeld

# print sites or species
head(x, choice = "sites")
head(x, choice = "sp") # choice can abbreviated

head(x, "si", n = 3) 
tail(x, choice = "sp", typeof = "character", n = 2)

head(VegsoupPartition(x, k = 2))

vegsoup documentation built on Feb. 24, 2021, 3 a.m.