percenta: Computation of percentage matrix

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

View source: R/percenta.R

Description

This function calculates percentage matrices based on a dataframe with species in columns and samples in rows.

Usage

1
percenta(x, first, last)

Arguments

x

Dataframe or matrix containing raw data with species in columns and samples in rows.

first

Number of first column in x (taxon) to be included in the sum that serves as basis for the percentage calculation (e.g. pollen sum, see Birks & Birks (1980)).

last

Number of last column in x (taxon) to be included in the sum that serves as basis for the percentage calculation (e.g. pollen sum, see Birks & Birks (1980)).

Details

Percentages can be calculated based on a selected group of columns or taxa (e.g. terrestrial taxa included in the pollen sum for palynological analyses, see Birks & Birks (1980) for illustration on pollen sum). For the rest of the columns (taxa) percentages are calculated based on totals from included columns (taxa), e.g. spores and aquatics.

The dataframe should be organized in such a way that taxa or columns to be included in the percentage calculation are contiguous. Percentages of other columns outside that range (first to last) are calculated based on the total sum of elements included (e.g. pollen sum).

Value

The function returns a dataframe containing calculated percentages, with species in columns and samples in rows.

Author(s)

Alexander Correa-Metrio, Dunia H. Urrego.

References

Birks, H. J. B., and Birks, H. H. (1980). Quaternary Palaeoecology. University Park Press, Baltimore.

See Also

scale

Examples

1
2
3
pollen<-matrix(nrow=10,sample(c(1:100),50))
colnames(pollen)<-c("Sp1","Sp2","Sp3","Sp4","Sp5")
percenta(pollen,first=1,last=5)

Example output

Loading required package: MASS
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.4-4
            Sp1       Sp2       Sp3        Sp4       Sp5
 [1,] 18.260870 38.260870 23.913043  0.4347826 19.130435
 [2,] 17.110266 14.068441 13.307985 23.1939163 32.319392
 [3,] 40.692641  4.761905 31.168831 14.2857143  9.090909
 [4,]  4.040404 31.313131 15.151515 27.2727273 22.222222
 [5,] 29.741379  3.017241 14.655172 32.7586207 19.827586
 [6,] 12.345679 19.135802 30.555556 18.5185185 19.444444
 [7,] 20.171674 12.017167 23.175966 34.7639485  9.871245
 [8,] 26.022305 21.933086 24.163569 24.5353160  3.345725
 [9,] 31.120332  6.639004  5.394191 32.7800830 24.066390
[10,] 26.315789 27.302632  6.250000 16.7763158 23.355263

paleoMAS documentation built on May 29, 2017, 8:26 p.m.