Learn R Programming

AlgDesign (version 1.2.1.1)

gen.factorial: Generates a full factorial design

Description

A full factorial design is generated.

Usage

gen.factorial(levels, nVars=0, center=TRUE, factors="none",varNames=NULL)

Value

A factorial design in a data.frame.

Arguments

levels

A vector of levels for the variables. May be an integer if nVars is specified.

nVars

The number of variables.

center

If TRUE, all non-factors will be centered.

factors

If "all", all variables are factors, otherwise a vector of the variable numbers of the variables that are to be factors.

varNames

The names of the variables.

Author

Bob Wheeler bwheelerg@gmail.com

Please cite this program as follows:

Wheeler, R.E. (2004). gen.factorial. AlgDesign. The R project for statistical computing https://www.r-project.org/

Examples

Run this code
dat<-gen.factorial(3,3)
dat<-gen.factorial(c(3,2,3))
dat<-gen.factorial(3,3,factors="all")
dat<-gen.factorial(3,3,varNames=c("A","B","C"))

Run the code above in your browser using DataLab