Skip to content
Prev 333327 / 398506 Next

Sending a matrix in an email

On Nov 18, 2013, at 8:30 AM, Ira Fuchs wrote:

            
After this at the console:

sink("myfile.txt")
 > x=matrix(c(1,2,3),1,3)
 > x
 > colnames(x)=c("a","b","c")
 > x
 > sink()

I get this in myfile.txt:

      [,1] [,2] [,3]
[1,]    1    2    3
      a b c
[1,] 1 2 3

There is also a capture.output function.