export.design {DoE.base}R Documentation

Function for exporting a design object

Description

Function for exporting a design object

Usage

export.design(design, response.names = "y", 
       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 a character vector of response names; the exported file contains a column for each response; default: one response named y
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 "html" or "csv"
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.csv or write.csv2 is used and is very important for usability of the exported files e.g. with Excel
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 case-insensitive platforms from inadvertent replacing of files (i.e. you cannot have TEST.html and test.html, even if it were allowed on your platform)
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

Details

Function export uses functions write.csv, write.csv2 or html for creating an exported version of the design that is usable outside of R. If type="csv", the design is exported as a csv-file, otherwise as an html-file. 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 by mixing up rows. If the OutDec option is correct for the current computer, the html file can be opened in Excel.

In addition to the html- or csv file, an R workspace containing just the design object is also output under the same name, with ending rda; if called from the R commander plugin, this workspace additionally contains the menu settings of the design generating menu.

Value

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

Note

This package is currently under intensive development. Substantial changes are to be expected in the near future.

Author(s)

Ulrike Groemping

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, oa.design, pb

Examples

  ## six 2-level factors
  test <- oa.design(nlevels=c(2,3,3,3))
  ## export an html file with legend and two responses
  export.design(test, response.names=c("pressure", "temperature"))

[Package DoE.base version 0.2 Index]