PMwriteMatrix
is the companion function to PMreadMatrix
.
It will write an appropriate R data object to a formatted .csv file.
Arguments
- data
Must be a data.frame with appropriate structure (see
PMcheck
.- filename
Name of file to create.
- override
Boolean operator to write even if errors are detected. Default is
False
.- version
Which matrix data format version to write. Default is the current version.
Value
Returns the error report (see PMcheck
for details).
Details
PMwriteMatrix
will first run PMcheck
to determine
if there are any errors in the structure of data
. If the error check
fails, the file will not be written and a message will be printed on the console.
Examples
if (FALSE) {
data(mdata.1)
#write to the current directory
PMwriteMatrix(mdata.1,"PMex1.csv")
#read it back
mdata <- PMreadMatrix("PMex1.csv")
}