Learn R Programming

planor (version 1.5-3)

planor.factors: Create an Object of Class designfactors

Description

Create an object of class '>designfactors, from the factor names and their numbers of levels, or from a named list of factor levels. Both ways can be used in the same call. Additional information can be provided: they will be used during the design search or in the summary functions applied to the object.

Usage

planor.factors(factors = NULL, nlevels = NULL,
  block = NULL, ordered = NULL, hierarchy = NULL,
  dummy = FALSE)

Arguments

factors

a character vector of factor names, or possibly a scalar, a dataframe or a list (see DETAILS).

nlevels

a vector of level numbers for each factor name (see DETAILS).

block

an additive model formula to indicate the block factors.

ordered

an additive model formula to indicate the quantitative factors (not used at all in the present version).

hierarchy

a formula or a list of formulae to indicate hierarchy relationships between factors (see the planor vignette for details).

dummy

a logical to identify dummy factors created and deleted by planor functions for technical reasons.

Value

An object of class '>designfactors.

See Also

Class '>designfactors

Examples

Run this code
# NOT RUN {
planor.factors(c("A","B","C","P"),c(2,3,6,3))
planor.factors(LETTERS[1:12],2)
planor.factors(12,2)
planor.factors( c("A","B","Block"), 3, block=~Block)
zz <- planor.factors( c("A","B","Block"), c(2,3,5))
zz@levels$A <- c("plus","moins")
planor.factors(factors=list(A=c("plus","moins"), B=1:3, Block=1:5))
AB <- data.frame( A=c(rep(c("a","b"),3)),
                  B=rep(c("z","zz","zzz"),rep(2,3)),
                  C=1:6,
                  stringsAsFactors = TRUE)
planor.factors(factors=AB)
# }

Run the code above in your browser using DataLab