plan <- fac.design(nlevels=c(2,3,2,4))
result <- rnorm(2*3*2*4)
add.response(plan,response=result)
## direct use of rnorm() is also possible, but looks better with 48
add.response(plan,response=rnorm(48))
if (FALSE) {
export.design(path="c:/projectA/experiments",plan)
## open exported file c:/projectA/experiments/plan.html
## with Excel
## carry out the experiment, input data in Excel or elsewhere
## store as csv file with the same name (or a different one, just use
## the correct storage name later in R), after deleting
## the legend portion to the right of the data area
## (alternatively, input data by typing them in in R (function fix or R-commander)
add.response(design="plan",response="c:/projectA/experiments/plan.csv",
rdapath="c:/projectA/experiments/plan.rda")
## plan is the name of the design in the workspace stored in rdapath
## assuming only responses were typed in
## should work on your computer regardless of system,
## if you adapt the path names accordingly
}
Run the code above in your browser using DataLab