outCSV {blockTools} | R 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
|
namesCol |
an optional vector of column names to be used in output files. |
file.names |
an optional list of strings specifying the output file names. |
digits |
number of digits to which to round multivariate distances in output files. |
... |
additional arguments passed to |
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.
Author(s)
Ryan T. Moore
See Also
outTeX
, write.csv
,
block
, assignment
Examples
data(x100)
# First, block
out <- block(x100, groups = "g", n.tr = 2, id.vars = c("id"), block.vars
= c("b1", "b2"), algorithm="optGreedy", distance =
"mahalanobis", level.two = FALSE, valid.var = "b1",
valid.range = c(0,500), verbose = TRUE)
# Second, assign
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 = list("file1", "file2", "file3"))
[Package blockTools version 0.6.4 Index]