R/rarefy.R

Defines functions rarefy

Documented in rarefy

rarefy <-
function(raw, fraction)
{
	if (fraction > 1)
	{
		stop("fraction must be less than 1")	
	}
	
	nr <- nrow(raw)
	
	indices <- sample(nr, floor(fraction*nr))
	
	return(raw[indices,])	
}
bblonder/timeordered documentation built on Aug. 29, 2023, 9:15 a.m.