Removed dependence on the Matrix package, because its matrices can't be written by write.table.