Many of the functions in this package, including make_design contain a lot of duplicate code. Such code could be moved to specific helper-functions. But independent of this: there might be simpler ways to accomplish some of the tasks.
Cell Identifiers
The cell identifiers can be generated very easy using the expand.grid function and the seq.character described in a previous issue.
# can be generated using the function seq.character described in a previous Issue;
idRow = c("A", "B", "C", "D");
nCols = 6;
# m = matrix-format
m = matrix(apply(expand.grid(idRow, seq(nCols)), 1, paste0, collapse=""), ncol= nCols);
print(m)
# as vector
as.vector(m);
as.vector(t(m)); # the transposed values
The last step would include cbind(as.vector(m), _thelabels).
It should be evaluated if this simpler code can be useful.
Function: make_design
Many of the functions in this package, including make_design contain a lot of duplicate code. Such code could be moved to specific helper-functions. But independent of this: there might be simpler ways to accomplish some of the tasks.
Cell Identifiers
The cell identifiers can be generated very easy using the expand.grid function and the seq.character described in a previous issue.
# can be generated using the function seq.character described in a previous Issue; idRow = c("A", "B", "C", "D"); nCols = 6; # m = matrix-format m = matrix(apply(expand.grid(idRow, seq(nCols)), 1, paste0, collapse=""), ncol= nCols); print(m) # as vector as.vector(m); as.vector(t(m)); # the transposed values
The last step would include cbind(as.vector(m), _thelabels).
It should be evaluated if this simpler code can be useful.