multispecies: Summarizes data from multiple species.

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/multispecies.R

Description

This function may be used to summarize data from different species or similar (e.g. different lineages, etc). By default, it summarizes with the mean and standard deviation, but different functions may be used.

Usage

1

Arguments

...

Input data to be summarized. It must be numeric and it can be multiple vectors of the same size and order, or more simply a matrix with all data to be summarised. The matrix must have the different species/data in columns.

FUN

This is a list of functions to be applied to summarize the data. By default it uses the mean and sd, but it can be any other function that returns a number from a vector (e.g. max, min) or a user-defined function. If the objects are named in the FUN list, than those names will be given to the resulting columns. Otherwise, function are applied in the same order as given.

na.rm

A logical indicating whether missing values should be removed. Will only work if the functions in FUN accept it.

Details

This function is a simple wrapper with some error checking for the native R function 'apply'.

Value

Returns a matrix with functions applied in the same order as FUN.

Author(s)

Pedro Tarroso <ptarroso@cibio.up.pt>

See Also

apply princomp prcomp

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
data(vipers)
data(d.gen)
data(grid)

# create a matrix of distances from sample points (columns) to all
# grid pixels
rd <- geo.dist(grid, vipers[,1:2])

#interpolate with idw
result <- intgen.idw(rd, d.gen)

ms <- multispecies(result)

# plot the mean
grid.image(ms, grid, main = "Mean")

# plot the standard deviation
grid.image(ms, grid, ic=2, main = "Standard Deviation")

phylin documentation built on Dec. 12, 2019, 5:07 p.m.