R/gettimelength.R

gettimelength <-
function(numbs,n){
		timeperiods <- which(numbs[,3]==n)
		timelength<-vector()
		if (length(timeperiods)>0){
		for (i in 1:length(timeperiods)){
			timelength <- c(timelength, numbs[timeperiods[i],2]-numbs[timeperiods[i]+1,2])
		}	
		}
		timelength
	}

Try the TreeSim package in your browser

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

TreeSim documentation built on May 2, 2019, 3:23 a.m.