R/generate.ith.superclass.R

`generate.ith.superclass` <- function(			#	specifying
	R,						#		a) the number of residual classes to bin into two superclasses
	superclass.index)				#		b) index of ith superclass composition of interest
{							#	the contents of the ith superclass is generated
	superclass.left <- numeric(R)
	superclass.left[1] <- 1						#first factor always present
	superclass.index <- superclass.index - 1			#use superclass.index as temporary variable
	for (superclass.left.index in 2:R) {
		superclass.left[superclass.left.index] <- superclass.index %% 2
		superclass.index <- floor(superclass.index / 2)
	}

	return(superclass.left)
}

Try the oblique.tree package in your browser

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

oblique.tree documentation built on April 15, 2017, 4:38 a.m.