outCSV: Export blocked or assigned data to .csv format files

View source: R/outCSV.R

outCSVR Documentation

Export blocked or assigned data to .csv format files

Description

Exports output from block or assignment to a set of .csv files using write.csv.

Usage

outCSV(block.obj, namesCol = NULL, file.names = NULL, digits = 2, ...)

Arguments

block.obj

A list of dataframes, such as output from block or assignment.

namesCol

An optional character vector of column names to be used in output files.

file.names

An optional character vector of file names specifying the output file names.

digits

An integer representing the number of decimal places to which to round multivariate distances in output files, passed to round().

...

Additional arguments passed to write.csv.

Details

Under the default (file.names = NULL), each file is named “GroupXXX.csv”, where “XXX” is the group name taken from the input object.

Value

A set of .csv files, one for each element of the input list of blocked or assigned units, written by write.csv().

Author(s)

Ryan T. Moore

See Also

outTeX, write.csv, block, assignment

Examples

data(x100)

# Block and assign:
out <- block(x100, groups = "g", n.tr = 2, id.vars = "id", block.vars = c("b1", "b2"))
assg <- assignment(out, seed = 123)

# create three .csv files of blocks
## Not run: outCSV(out)
# create three .csv files of assigned blocks
#   (note: overwrites blocked .csv files)
## Not run: outCSV(assg)
# create three .csv files with custom file names
## Not run: outCSV(assg, file.names = c("file1", "file2", "file3"))


blockTools documentation built on Oct. 20, 2024, 1:08 a.m.