| readCA | R Documentation |
reads a text file into a matrix of class ca (for covering array)
readCA(path, flexible.symbols=c("*","-","."), comment.symbol="C",
ninstruct=1, skiplines=0, ignore.chars=NULL, nosep=FALSE, origin=NULL, ...)
funmakefromstrings(stringvec)
path |
a character string that specifies the path, including the file name; see Section Details for requirements the file must satisfy. |
flexible.symbols |
characters to be treated as flexible values (will be set to NA) |
comment.symbol |
character that starts a comment line |
ninstruct |
integer, number of lines with instructions (1 or 0) |
skiplines |
integer, number of lines with no readable instructions and no defined comment character that should nevertheless be skipped; those are assumed to be above the instructions line |
ignore.chars |
|
nosep |
logical; set to TRUE, if the data lines do not contain separators and each character is a data value |
origin |
character string to be attached to the output array as origin-attribute;
if |
... |
further arguments for function |
stringvec |
vector of n character strings of equal lengths (k, say). The character strings should consist of digits
and small letters. Digits will remain unchanged, and the letters
|
The output object of readCA is a matrix
of class ca. The output object of funmakefromstrings
is an n x k matrix of numeric values. funmakefromstrings is
used by readCA, but can also be used on its own.
The file fn may start with comment lines that begin with a comment symbol, and an instruction line.
The first line after removing the comments lines contains instructions about the file content,
in the form N k v1^k1 v2^k2 ... It is permissible for the instructions line
to have a single string without blanks or ^ (e.g., for the strength)
after the exponential notation for the columns; this will be ignored in the
reading process. ninstruct=0 indicates that there is no instruction line.
All columns of the array must have the same starting value, i.e., start all with 0 or all with 1.
## values start with 0
funmakefromstrings(c("0123456789abc", "1032547698cba"))
## values start with 1
funmakefromstrings(c("123456789abc", "132547698cba"))
## values start with 4 (would usually not make sense)
funmakefromstrings(c("456789abc", "547698cba"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.