R/paa.R

paa <- 
function(data, sppVector){
	singPoly <- function(vec){
		aa <- unique(vec)
		bb <- length(aa)
		cc <- ifelse(bb == 1, aa, "poly")
		cc
		}
	apply(data, MARGIN = 2, FUN = function(x) tapply(x, sppVector, singPoly))
}

Try the spider package in your browser

Any scripts or data that you put into this service are public.

spider documentation built on May 2, 2019, 5:16 p.m.