Learn R Programming

DoE.base (version 0.23-2)

export.design: Function for exporting a design object

Description

Function for exporting a design object

Usage

export.design(design, response.names = NULL, 
       path = ".", filename = NULL, legend = NULL, type = "html", 
       OutDec = options("OutDec")$OutDec, replace = FALSE, ...)
html(object, ...)
## S3 method for class 'data.frame':
html(object, file = paste(first.word(deparse(substitute(object))),
    "html", sep = "."), append = FALSE, link = NULL, linkCol = 1, bgs.col = NULL,
          OutDec=options("OutDec")$OutDec, linkType = c("href", "name"), ...)

Arguments

design
A data frame of class design; it must be stored in the global environment and referred to by its name, i.e. it cannot be created on the fly.
response.names
if not NULL (default), this must be a character vector of response names; the exported file contains a column for each entry; it is NOT necessary to include responses that are already present in the design object!
path
the path to the directory where the export files are to be stored; the default corresponds to the R working directory that can (on some systems) be looked at using getwd()
filename
character string that gives the file name (without extension) for the files to be exported; if NULL, it is the name of the design object
legend
data frame containing legend information; if NULL, the legend is automatically generated from the factor.names element of design.info(design)
type
one of "rda", "html", "csv", or "all". An R workspace with just the design object is always stored as an "rda" object. If one of the other types is specified, the design
OutDec
decimal separator for the output file; one of "." or ","; the default is the option setting in the R options; this option also directs whether write.cs
replace
logical indicating whether an existing file should be replaced; if FALSE (default), the routine aborts without any action if one of the files to be created exists; checking is not case-sensitive in order to protect users on c
object
object to be exported to html
file
file to export the object to
append
append data frame to existing file ?
link
not used, unchanged from package Hmisc
linkCol
not used, unchanged from package Hmisc
bgs.col
background colors for data frame rows, default white and grey
linkType
not used, unchanged from package Hmisc
...
further arguments to function html, usable e.g. for modifying row coloring

Value

  • The functions are used for their side effects and do not generate a result.

Details

Function export.design always stores an R workspace that contains just the design (with attached attributes, cf. class design). This file is stored with ending rda. If requested by options type="csv", type="html", or type="all", export.design additionally creates an exported version of the design that is usable outside of R. This is achieved via functions write.csv, write.csv2 or html. The csv-file contains the data frame itself only, the html file contains the data frame followed by the legend to the right of the data frame. The html file uses row coloring in order to prevent mistakes in recording of experimental results by mix-ups of rows. If the OutDec option is correct for the current computer, the csv and html files can be opened in Excel, and decimal numbers are correctly interpreted. Generation of the html-file is particularly important for Taguchi inner/outer array designs in wide format, because it provides the legend to the suffix numbers of response columns in terms of outer array experimental setups! The function html and its data frame method are internal.

References

Hedayat, A.S., Sloane, N.J.A. and Stufken, J. (1999) Orthogonal Arrays: Theory and Applications, Springer, New York.

See Also

See also FrF2-package, DoE.wrapper-package

Examples

Run this code
## six 2-level factors
  test <- oa.design(nlevels=c(2,3,3,3))
  ## export an html file with legend and two responses
  ## files test.rda and test.html will be written to the current working directory, 
  ##     if they do not exist yet
  export.design(test, response.names=c("pressure", "temperature"))

Run the code above in your browser using DataLab