factorize {conf.design}R Documentation

Generic function.

Description

The default method factorizes positive numeric integer arguments, returning a vector of prime factors. The factor method can be used to generate pseudo-factors. It accepts a factor, f, as principal argument and returns a design with factors fa, fb, ...{} each with a prime number of levels such that f is model equivalent to join(fa, fb, ...{}).

Usage

factorize(x, ...)

Arguments

x Principal argument. At this stage, it may be a numeric vector to elicit the default method, or a factor to elicit the factor method.
... Additional arguments, if any.

Details

Factorizes by a clumsy though effective enough way for small integers. May become very slow if some prime factors are large. For the factor method it generates pseudo factors in the usual way.

Value

A vector of (numeric) factors for numeric arguments, or a design with (S-PLUS) factors with prime numbers of levels for factor arguments.

Side Effects

None.

See Also

conf.design, join

Examples

 factorize(18)
 # [1] 2 3 3
 f <- factor(rep(0,5), rep(6,5))
 fd <- factorize(f)