Skip to content
Prev 85534 / 398506 Next

Write.table: change points to commas when object contains a row of characters

You cannot have a matrix or a data frame which is partially numeric and 
partially character (within a column for a data frame).  You seem rather 
to have a list matrix.  Then ?write.table does say

      Any columns in a data frame which are lists or have a class (e.g.
      dates) will be converted by the appropriate 'as.character' method:
      such columns are unquoted by default.  On the other hand, any
      class information for a matrix is discarded.

Although it does not say so, the same happens with a matrix.

You need to get a table before you try outputting it: I suggest using 
format() to help you.
On Wed, 1 Feb 2006, Michael Reinecke wrote: