#! /bin/sh
# This is a shell archive, meaning:
# 1. Remove everything above the #! /bin/sh line.
# 2. Save the resulting text in a file.
# 3. Execute the file with /bin/sh (not csh) to create the files:
# README.design
# index.entry
# install.design
# conf.design.d
# conf.design.q
# conf.set.d
# direct.sum.d
# factorize.d
# join.d
# rjoin.d
# primes.d
#
if test -f 'README.design'
then
echo shar: will not over-write existing file "'README.design'"
else
echo x - 'README.design'
sed 's/^X//' >'README.design' << 'SHAR_EOF'
X Construction of factorial designs.
X
X1. INTRODUCTION
X
XThis small library contains a series of simple tools for constructing and
Xmanipulating confounded and fractional factorial designs. To some extent
Xthese complement those already available in S-PLUS 3.1 and 3.2, (but they
Xmay well be rendered obsolete by S+DOX, to which the author does not yet
Xhave access).
X
XThe term `design' is used in the Design of Experiments sense, and is always
Xrepresented by an S-PLUS "design", that is a list object of class "design"
Xinheriting from class "data.frame".
X
X2. SUMMARY OF FUNCTIONS SUPPLIED
X
Xconf.design - Construct a single replicate symmetric factorial design.
X The user supplies a matrix, D, whose rows definine the effects to be
X confounded in exactly the way as in Collings (1989). The result is a
X design with the first column a factor defining the blocks of the
X experiment and the next ncol(D) columns the treatment factors.
X
Xconf.set - For a set of defining contrasts of a confounding scheme,
X constructs a minimal set of confounded effects. Effects are specified
X as for conf.design and the result is returned the same way. Intended
X to be used to check if a low order interaction has accidently been
X confounded.
X
Xdirect.sum - Constructs the direct sum of two or more designs. Each plot
X of one design is matched with every plot of the other. (This might
X also be called the Cartesian product of two designs).
X
Xjoin - Combine two or more factors into a single factor defining the sub-
X classes. The level names are concatenated. If f1 and f2 are factors,
X join(f1, f2) is equivalent to the term f1:f2 in a model formula.
X
Xrjoin - join two or more designs into a single design by row concatenation,
X similar to `rbind'. The component designs must have identical names.
X An additional factor is also generated in the result that identifies
X the individual components.
X
Xfactorize - Generic function. The "default" method factorizes positive
X numeric integer arguments, returning a vector of prime factors. The
X "factor" method can be used to generate pseudo-factors. It accepts a
X factor, f, as principal argument and returns a design with factors fa,
X fb, ... each with a prime number of levels such that in a model formula
X f is equivalent to join(fa, fb, ...). (Like the opposite of join().)
X
Xprimes - Generate all prime numbers less than its (scalar) argument, n.
X Uses a naive sieve method. Now of curiosity value only; it is no
X longer used by other functions in the library.
X
X4. REFERENCE:
X
XCollings, B. J. (1989) Quick confounding. Technometrics, v31, pp107-110.
X
X5. INSTALLATION:
X
X-- To make available as a local library, "design":
X
X(a) Copy the shell archive file to $SHOME/library, cd there, and unshar it
X again.
X
X(b) Check that nothing in the shell script install.design is likely to
X cause conflict. If not, execute it:
X
X$ sh install.design
X
X(c) Test it out elsewhere using "library(design)" in S.
X
X-- To install the functions in some .Data directory, having unshar'd this
X file in the working directory above it, adapt and use as many of the
X following steps as necessary:
X
X$ mkdir .Data
X$ Splus < conf.design.q
X$ mkdir .Data/.Help
X$ cp conf.design.d .Data/.Help/conf.design
X$ cp conf.set.d .Data/.Help/conf.set
X$ etc..
X
X6. EXAMPLES.
X
X6.1 Generate a single replicate 3^4 design with factors A, B, C and D,
X with effects A B^2 D and A B C confounded with blocks. The design will
X have 9 blocks of size 9:
X
X> D <- rbind(c(1,2,0,1), c(1,1,1,0))
X> dimnames(D) <- list(NULL, LETTERS[1:4])
X> cfd <- conf.design(D, 3)
X> names(cfd)
X[1] "Blocks" "A" "B" "C" "D"
X> levels(cfd$Blocks)
X[1] "00" "01" "02" "10" "11" "12" "20" "21" "22"
X
X In addition to the factors a block design is generated with levels
X indicating how the block is generated in the confounding scheme. This
X allows individidual fractions of the design to be easily extracted.
X
X We can also identify which other effects are confounded with blocks:
X
X> conf.set(D, 3)
X A B C D
X[1,] 1 2 0 1
X[2,] 1 1 1 0
X[3,] 0 1 2 1
X[4,] 1 0 2 2
X
X i.e., from the last two rows, B C^2 D and A C^2 D^2 are also
X confounded.
X
X6.2 Generate a half replicate of a 2^3 x 3^2 experiment. The factors are
X to be A, B, C, D, E. The fractional relation is to be I = ABC and the
X DE effect is to be confounded with blocks.
X
X First construct the 2^3 design, confounded in two blocks:
X> d1 <- conf.design(c(1,1,1), p=2, treatment.names=LETTERS[1:3])
X
X Next the 3^2 design, with DE confounded in blocks:
X> d2 <- conf.design(c(1,1), p=3, treatment.names=LETTERS[4:5])
X
X Now extract the principal block from the 2^3 design and form the direct
X sum withthe 3^2 design
X> dsn <- direct.sum(d1[d1$Blocks=="0",], d2)
X
X Now to do some checks.
X> nrow(dsn)
X[1] 36
X> names(dsn)
X[1] "Blocks" "A" "B" "C" "Blocksa" "D" "E"
X
X The two factors "Blocks" and "Blocksa" together define the blocks.
X Amalgamate them into a single Blocks factor and prune:
X> dsn$Blocks <- join(dsn$Blocks, dsn$Blocksa)
X> dsn$Blocksa <- NULL
X
X We can check the confounding by analysing some dummy data:
X
X> y <- rnorm(36)
X> fm <- aov(y ~ A*B*C*D*E + Error(Blocks), data=dsn)
X> summary(fm)
XError: Blocks
X Df Sum of Sq Mean Sq
XD:E 2 4.6499 2.325
X
XError: Within
X Df Sum of Sq Mean Sq
XA 1 0.442 0.4418
XB 1 0.035 0.0350
XC 1 1.976 1.9759
XD 2 3.182 1.5909
XE 2 2.320 1.1598
XA:D 2 3.873 1.9365
XB:D 2 0.982 0.4912
XC:D 2 1.155 0.5775
XA:E 2 2.982 1.4908
XB:E 2 0.415 0.2077
XC:E 2 11.132 5.5660
XD:E 2 0.378 0.1892
XA:D:E 4 8.581 2.1453
XB:D:E 4 7.079 1.7698
XC:D:E 4 7.647 1.9116
X>
X As required, DE is totally confounded with Blocks and only the main
X effects, A, B, and C, and their interactions with D and E are estimable
X within blocks.
X
X6.3 Construct a 3 replicate design for a 2^3 experiment using 6 blocks of
X size 4, partially confounding the effects ABC, AB and AC.
X
X> d1 <- conf.design(c(1,1,1), 2, treatment.names=c("A","B","C"))
X> d2 <- conf.design(c(1,1,0), 2, treatment.names=c("A","B","C"))
X> d3 <- conf.design(c(1,0,1), 2, treatment.names=c("A","B","C"))
X> d123 <- rjoin(d1,d2,d3)
X> names(d123)
X[1] "Part" "Blocks" "A" "B" "C"
X> d123$Blocks <- join(d123$Part, d123$Blocks)
X
X The last step makes "Blocks" into a factor with 6 rather than 2 levels.
X
X7. RE-DISTRIBUTION STATEMENT:
X
XThis software may be re-distributed freely and used for any non-commercial
Xpurpose.
X
X8. DISCLAIMER:
X
XThe author accepts no responsibility for the correctness or usability of
Xthe results of this software. All results should be checked by a dummy
Xanalysis.
X
X9. FOLLOWUP ASSISTANCE:
X
XThe author is willing to discuss problems users may have with the software
Xby email at the address below. I am also anxious to recieve notification
Xof any bugs, or preferably, bug fixes!
X___________________________________________________________________________
XBill Venables, Department of Statistics, Telephone: +61 8 303 3026
XThe University of Adelaide, Facsimile: +61 8 232 5670
XSouth AUSTRALIA. 5005. Email: venables@stats.adelaide.edu.au
SHAR_EOF
if test 7342 -ne "`wc -c < 'README.design'`"
then
echo shar: error transmitting "'README.design'" '(should have been 7342 characters)'
fi
fi
if test -f 'index.entry'
then
echo shar: will not over-write existing file "'index.entry'"
else
echo x - 'index.entry'
sed 's/^X//' >'index.entry' << 'SHAR_EOF'
Xconf.design - A collection of simple functions to generate and manipulate
X confounded and fractional factorial designs.
X
SHAR_EOF
if test 134 -ne "`wc -c < 'index.entry'`"
then
echo shar: error transmitting "'index.entry'" '(should have been 134 characters)'
fi
fi
if test -f 'install.design'
then
echo shar: will not over-write existing file "'install.design'"
else
echo x - 'install.design'
sed 's/^X//' >'install.design' << 'SHAR_EOF'
X#!/bin/sh
X
X# Change if the next command is not your usual S (or S-PLUS) invocation"
XS=Splus
X
Xfuns="conf.design conf.set direct.sum factorize join primes rjoin"
X
Xecho "Checking for directories..."
Xif test ! -d design; then
X mkdir design;
Xfi
Xcd design
Xif test ! -d .Data; then
X mkdir .Data
Xfi
Xif test ! -d .Data/.Help; then
X mkdir .Data/.Help
Xfi
X
Xecho "Transferring help files..."
Xfor i in $funs;
Xdo cp ../$i.d .Data/.Help/$i
Xdone
X
Xecho "Installing S functions in .Data..."
X
X$S < ../conf.design.q 2>&1 >> installation.log
X
Xcd .Data
Xrm -f .Audit .Last.value
X
Xecho "That's it."
Xexit 0
SHAR_EOF
if test 583 -ne "`wc -c < 'install.design'`"
then
echo shar: error transmitting "'install.design'" '(should have been 583 characters)'
fi
fi
if test -f 'conf.design.d'
then
echo shar: will not over-write existing file "'conf.design.d'"
else
echo x - 'conf.design.d'
sed 's/^X//' >'conf.design.d' << 'SHAR_EOF'
X.BG
X.FN conf.design
X.TL
XConstruct symmetric confounded factorial designs.
X.DN
X~brief description
X.CS
Xconf.design(G, p, block.name="Blocks", treatment.names=<>)
X.RA
X.AG G
XMatrix whose rows define the contrasts to be confounded. For example in a
X3^4 experiment with A B^2 C and B C D confounded with blocks (together with
Xtheir generalized interactions), the matrix G would be rbind(c(1,2,1,0),
Xc(0,1,1,1)). The number of columns of G is the number of factors.
X.AG p
XThe common number of levels for each factor. Must be a prime number.
X.OA
X.AG block.name
XName to be given to the factor defining the blocks of the design.
X.AG treatment.names
XName to be given to the treatment factors of the design. If G has a
Xdimnames attribute, then dimnames[[2]] is the default, otherwise T1, T2,
X... are the default names.
X.RT
XA design with a Blocks factor defining the blocks and Treatment factors
Xdefining the way treatments are allocated to each plot. Not in random
Xorder.
X.SE
XNone.
X.DT
XFor a single replicate of treatments, blocks are calculated using the
Xconfounded contrasts in the standard textbook way. The method is related
Xto that of Collings (1989).
X.SH REFERENCES
XCollings, B. J. (1989) Quick confounding. Technometrics, v31, pp107-110.
X.SA
Xconf.set, direct.sum, fac.design, fractionate
X.EX
X# Generate a 3^4 factorial with A B^2 C and B C D confounded with blocks.
X> d34 <- conf.design(rbind(c(1,2,1,0), c(0,1,1,1)), p=3, treatment.names =
X+ LETTERS[1:4])
X.KW design
X.WR
SHAR_EOF
if test 1493 -ne "`wc -c < 'conf.design.d'`"
then
echo shar: error transmitting "'conf.design.d'" '(should have been 1493 characters)'
fi
fi
if test -f 'conf.design.q'
then
echo shar: will not over-write existing file "'conf.design.q'"
else
echo x - 'conf.design.q'
sed 's/^X//' >'conf.design.q' << 'SHAR_EOF'
X"conf.design"<-
Xfunction(G, p, block.name = "Blocks", treatment.names = if(length(nam <-
X dimnames(G)[[2]]) == 0) paste("T", 1:ncol(G), sep = "") else nam)
X{
X list.mat <- function(M, f)
X {
X l <- list()
X for(i in 1:ncol(M))
X l[[i]] <- f(M[, i])
X l
X }
X if(!is.matrix(G))
X G <- matrix(G, nrow = 1)
X nf <- ncol(G)
X D <- as.matrix(0:(p - 1))
X if(nf > 1)
X for(j in 2:nf) {
X E <- D
X D <- NULL
X for(i in 0:(p - 1))
X D <- rbind(D, cbind(E, i))
X }
X m <- (D %*% t(G)) %% p
X B <- do.call("paste", c(list.mat(m, format), list(sep = "")))
X D <- cbind(B, format(D))[sort.list(B), ]
X D <- as.data.frame(list.mat(D, as.factor))
X names(D) <- c(block.name, treatment.names)
X class(D) <- c("design", class(D))
X D
X}
X"conf.set"<-
Xfunction(G, p)
X{
X space <- function(G, p)
X {
X#
X# Generate all distinct linear combinations of the rows of G over GF(p)
X#
X x <- 0:(p - 1)
X M <- as.matrix(x)
X k <- nrow(G)
X if(k > 1) {
X for(i in 2:k) {
X N <- NULL
X for(j in x)
X N <- rbind(N, cbind(M, j))
X M <- N
X }
X }
X M <- (M %*% G) %% p #
X# if the rows of G can be assumed linearly independent the rest can be omitted.
X#
X m <- 0
X for(j in 1:ncol(M))
X m <- p * m + M[, j]
X M[!duplicated(m), , drop = F]
X }
X S <- space(G, p)
X S[apply(S, 1, function(x)
X any(t <- x > 0) && x[t][1] == 1), ]
X}
X"direct.sum"<-
Xfunction(D1, D2, ..., tiebreak = letters)
X{
X l <- list(...)
X if(length(l))
X return(Recall(D1, Recall(D2, ..., tiebreak = tiebreak[-1]),
X tiebreak = tiebreak))
X E1 <- lapply(D1, function(x, n2)
X rep(x, rep(n2, length(x))), nrow(D2))
X E2 <- lapply(D2, function(x, n1)
X rep(x, n1), nrow(D1))
X D <- c(E1, E2)
X if(any(i <- duplicated(names(D))))
X names(D)[i] <- paste(names(D)[i], tiebreak[1], sep = "")
X D <- as.data.frame(D)
X class(D) <- c("design", class(D))
X D
X}
X"factorize"<-
Xfunction(x, ...)
XUseMethod("factorize")
X"factorize.default"<-
Xfunction(n)
X{
X if(!is.numeric(n))
X stop("cannot factorize non-numeric arguments")
X if(length(n) > 1) {
X l <- list()
X for(i in seq(along = n))
X l[[i]] <- Recall(n[i])
X return(l)
X }
X if(n != round(n) || n < 2)
X return(n)
X tab <- 2:n
X fac <- numeric(0)
X while(n > 1) {
X while(n %% tab[1] == 0) {
X fac <- c(fac, tab[1])
X n <- n/tab[1]
X }
X tab <- tab[tab <= n]
X omit <- tab[1] * c(1, tab[tab <= n/tab[1]])
X tab <- tab[ - match(omit, tab, nomatch = 0)]
X }
X fac
X}
X"factorize.factor"<-
Xfunction(x, name = deparse(substitute(x)), extension = letters, drop = T, sep
X = "")
X{
X llev <- factorize.default(length(levels(x)))
X if(length(llev) == 1)
X return(if(drop) x else {
X x <- design(x)
X names(x) <- name
X x
X }
X )
X D <- NULL
X for(i in llev) {
X E <- D
X D <- NULL
X for(j in 1:i)
X D <- rbind(D, cbind(j, E))
X }
X l <- list()
X for(i in seq(along = llev))
X l[[i]] <- factor(as.numeric(merge.levels(x, D[, i])) - 1)
X l <- as.data.frame(l)
X names(l) <- paste(name, extension[1:length(llev)], sep = sep)
X class(l) <- c("design", class(l))
X l
X}
X"join"<-
Xfunction(...)
X{
X m <- list(...)
X l <- list()
X for(i in seq(along = m))
X l <- c(l, if(is.list(k <- m[[i]])) k else list(k))
X l <- lapply(l, function(f)
X format(as.character(f)))
X as.factor(do.call("paste", c(l, list(sep = ""))))
X}
X"rjoin"<-
Xfunction(..., part.name = "Part")
X{
X l <- lapply(list(...), as.data.frame) # for some safety...
X bf <- factor(paste(part.name, rep(1:length(l), sapply(l, nrow)), sep =
X ""))
X D <- as.data.frame(c(list(bf), as.list(do.call("rbind", l))))
X names(D) <- c(part.name, names(l[[1]]))
X class(D) <- c("design", class(D))
X D
X}
X"primes"<-
Xfunction(n)
X{
X# Find all primes less than n (or max(n) if length(n) > 1).
X# Uses an obvious sieve method. Nothing flash.
X#
X pr <- numeric(0)
X if((n <- max(n)) > 1) {
X tab <- 2:n
X repeat {
X if(tab[1] > n/tab[1])
X return(c(pr, tab))
X pr <- c(pr, tab[1])
X omit <- tab[1] * c(1, tab[tab <= n/tab[1]])
X tab <- tab[ - match(omit, tab, nomatch = 0)]
X }
X }
X pr
X}
X".First.lib"<-
Xfunction(library, section)
X{
X o <- objects(paste(library, section, ".Data", sep="/"))
X m <- match(".First.lib", o, nomatch=F)
X cat("Functions available:\n")
X print(if(m) o[-m] else o, quote=F)
X}
X
Xhelp.findsum(".Data")
SHAR_EOF
if test 4095 -ne "`wc -c < 'conf.design.q'`"
then
echo shar: error transmitting "'conf.design.q'" '(should have been 4095 characters)'
fi
fi
if test -f 'conf.set.d'
then
echo shar: will not over-write existing file "'conf.set.d'"
else
echo x - 'conf.set.d'
sed 's/^X//' >'conf.set.d' << 'SHAR_EOF'
X.BG
X.FN conf.set
X.TL
XFind confounded effects.
X.DN
XFind minimal complete sets of confounded effects from a defining set for
Xsymmetric confounded factorial designs. Useful for checking if a low order
Xinteraction will be unintentionally confounded with blocks. As in the
Xusual convention, only effects whose leading factor has an index of one are
Xlisted.
X.CS
Xconf.set(G, p)
X.RA
X.AG G
XMatrix whose rows define the effects to be confounded with blocks, in the
Xsame way as for conf.design().
X.AG p
XNumber of levels for each factor. Must be a prime number.
X.RT
XA matrix like G with a minimal set of confounded with blocks defined in the
Xrows.
X.SE
XNone
X.DT
XThe function constructs all linear functions of the rows of G (over GF(p)),
Xand removes those rows whose leading non-zero component is not one.
X.SA
Xconf.design
X.EX
X> G <- rbind(c(1,2,1,0), c(0,1,1,1))
X> dimnames(G) <- list(NULL, LETTERS[1:4])
X> conf.set(G, 3)
X A B C D
X[1,] 1 2 1 0
X[2,] 0 1 1 1
X[3,] 1 0 2 1
X[4,] 1 1 0 2
X> # If A B^2 C and B C D are confounded with blocks, then so are A C^2 D
X> # and A B D^2. Only three-factor interactions are confounded, so the
X> # design is presumably useful.
X.KW design
X.WR
SHAR_EOF
if test 1169 -ne "`wc -c < 'conf.set.d'`"
then
echo shar: error transmitting "'conf.set.d'" '(should have been 1169 characters)'
fi
fi
if test -f 'direct.sum.d'
then
echo shar: will not over-write existing file "'direct.sum.d'"
else
echo x - 'direct.sum.d'
sed 's/^X//' >'direct.sum.d' << 'SHAR_EOF'
X.BG
X.FN direct.sum
X.TL
XForm the direct sum of designs.
X.DN
XConstructs the direct sum of two or more designs. Each plot of one design
Xis matched with every plot of the other. (This might also be called the
XCartesian product of two designs).
X.CS
Xdirect.sum(D1, D2, ..., tiebreak=letters)
X.RA
X.AG D1
XFirst component design.
X.AG D2
XSecond component design.
X.OA
X.AG ...
XAdditional component designs, if any.
X.AG tiebreak
XSeries of characters or digits to be used for breaking ties (or repeats) in
Xthe variable names in the component designs.
X.RT
XThe direct sum of all component designs.
X.SE
XNone.
X.DT
XEach plot of one design is matched with every plot of the other, and so on
Xrecursively.
X.SA
Xconf.design, fac.design, fractionate
X.EX
X> # Generate a half replicate of a 2^3 x 3^2 experiment. The factors are
X> # to be A, B, C, D, E. The fractional relation is to be I = ABC and the
X> # DE effect is to be confounded with blocks.
X
X> # First construct the 2^3 design, confounded in two blocks:
X> d1 <- conf.design(c(1,1,1), p=2, treatment.names=LETTERS[1:3])
X
X> # Next the 3^2 design, with DE confounded in blocks:
X> d2 <- conf.design(c(1,1), p=3, treatment.names=LETTERS[4:5])
X
X> # Now extract the principal block from the 2^3 design and form the direct
X> # sum withthe 3^2 design
X> dsn <- direct.sum(d1[d1$Blocks=="0",], d2)
X
X.KW design
X.WR
SHAR_EOF
if test 1339 -ne "`wc -c < 'direct.sum.d'`"
then
echo shar: error transmitting "'direct.sum.d'" '(should have been 1339 characters)'
fi
fi
if test -f 'factorize.d'
then
echo shar: will not over-write existing file "'factorize.d'"
else
echo x - 'factorize.d'
sed 's/^X//' >'factorize.d' << 'SHAR_EOF'
X.BG
X.FN factorize
X.TL
XGeneric function.
X.DN
XThe default method factorizes positive numeric integer arguments, returning
Xa vector of prime factors. The factor method can be used to generate
Xpseudo-factors. It accepts a factor, f, as principal argument and returns
Xa design with factors fa, fb, ... each with a prime number of levels such
Xthat f is model equivalent to join(fa, fb, ...).
X.CS
Xfactorize(x, ...)
X.RA
X.AG x
XPrincipal argument. At this stage, it may be a numeric vector to elicit
Xthe default method, or a factor to elicit the factor method.
X.OA
X.AG ...
XAdditional arguments, if any.
X.RT
XA vector of (numeric) factors for numeric arguments, or a design with
X(S-PLUS) factors with prime numbers of levels for factor arguments.
X.SE
XNone.
X.DT
XFactorizes by a clumsy though effective enough way for small integers.
XMay become very slow if some prime factors are large. For the factor
Xmethod it generates pseudo factors in the usual way.
X.SA
Xconf.design, join
X.EX
X> factorize(18)
X[1] 2 3 3
X> f <- factor(rep(0:5, rep(6,5))
X> fd <- factorize(f)
X.KW design
X.WR
X
SHAR_EOF
if test 1068 -ne "`wc -c < 'factorize.d'`"
then
echo shar: error transmitting "'factorize.d'" '(should have been 1068 characters)'
fi
fi
if test -f 'join.d'
then
echo shar: will not over-write existing file "'join.d'"
else
echo x - 'join.d'
sed 's/^X//' >'join.d' << 'SHAR_EOF'
X.BG
X.FN join
X.TL
XAmalgamate two or more factors.
X.DN
XJoins two or more factors together into a single composite factor defining
Xthe subclasses. In a model formula join(f1, f2, f3) is equivalent to
Xf1:f2:f3.
X.CS
Xjoin(...)
X.RA
X.AG ...
XTwo or more factors or numeric vectors, or objects of mode list containing
Xthese kinds of component.
X.RT
XA single composite factor with levels made up of the distinct combinations
Xof levels or values of the arguments which occur.
X.SE
XNone.
X.DT
XSimilar in effect to paste(), which it uses.
X.SA
Xpaste, rjoin, direct.sum
X.EX
X> fABC <- join(fA, fB, fC)
X.KW design
X.WR
SHAR_EOF
if test 598 -ne "`wc -c < 'join.d'`"
then
echo shar: error transmitting "'join.d'" '(should have been 598 characters)'
fi
fi
if test -f 'rjoin.d'
then
echo shar: will not over-write existing file "'rjoin.d'"
else
echo x - 'rjoin.d'
sed 's/^X//' >'rjoin.d' << 'SHAR_EOF'
X.BG
X.FN rjoin
X.TL
XConcatenate designs by rows.
X.DN
XCombine two or more designs with the same names into a single design by row
Xconcatenation.
X.CS
Xrjoin(..., part.name="Part")
X.RA
X.AG ...
XTwo or more designs with identical component names.
X.OA
X.AG part.name
XName for an additional factor to identify the original components in the result.
X.RT
XA single design with the arguments stacked above each other (in a similar
Xmanner to rbind()), together with an additional factor whose levels
Xidentify the original component designs, or `parts'.
X.SE
XNone.
X.DT
XAlmost the same as rbind(), but an additional factor in the result
Xseparates the original components.
X.SA
Xconf.design, join, direct.sum
X.EX
X> # A two replicate partially confounded factorial design.
X> d1 <- conf.design(c(1,1,1), 2, treatment.names=LETTERS[1:3])
X> d2 <- conf.design(c(0,1,1), 2, treatment.names=LETTERS[1:3])
X> dsn <- rjoin(d1, d2)
X.KW design
X.WR
SHAR_EOF
if test 914 -ne "`wc -c < 'rjoin.d'`"
then
echo shar: error transmitting "'rjoin.d'" '(should have been 914 characters)'
fi
fi
if test -f 'primes.d'
then
echo shar: will not over-write existing file "'primes.d'"
else
echo x - 'primes.d'
sed 's/^X//' >'primes.d' << 'SHAR_EOF'
X.BG
X.FN primes
X.TL
XPrime numbers
X.DN
XGenerate a table of prime numbers.
X.CS
Xprimes(n)
X.RA
X.AG n
XPositive integer value.
X.RT
XA vector of all prime numbers less than the argument. 1 is not a prime.
X.SE
XNone
X.DT
XUses an elementary sieve method, not suitable for very large n. This
Xfunction is no longer used as part of the design library and is included
Xfor curiosity value only.
X.SA
Xfactorize
X.EX
X> primes(50)
X [1] 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47
X.KW design
X.WR
SHAR_EOF
if test 475 -ne "`wc -c < 'primes.d'`"
then
echo shar: error transmitting "'primes.d'" '(should have been 475 characters)'
fi
fi
echo Done
exit 0