R/ryule.R

Defines functions ryule

Documented in ryule

ryule <-  function(n){

	lst<-(-n):(-1)

	Data <- matrix(NA, nrow = n-1, ncol = 2)
	X <- NULL
	S <- 0
	for (i  in 1:(n-1)){
		Data[i, 1:2] <- xx <- sort(sample(lst, 2,replace= FALSE))
		lst <- c(lst[ (lst !=xx[1]) & (lst != xx[2]) ],i)
	}
	treeshape(Data)
}

Try the apTreeshape package in your browser

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

apTreeshape documentation built on Jan. 8, 2021, 2:07 a.m.