1. Please use an informative subject line.

2. Try something like the following:

> m <- matrix(1:8, 2, 4, byrow=TRUE)
> outfile <- file("test.txt", open="w")
> writeLines("#data1", outfile)
> write(t(m), outfile, ncol=ncol(m))
> close(outfile)
> file.show("test.txt")

Consult the relevant help pages for the functions used above.

HTH,
Andy


> -----Original Message-----
> From: michael kirschbaum [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, July 15, 2003 9:56 AM
> To: [EMAIL PROTECTED]
> Subject: [R] (no subject)
> 
> 
> Hi 
> I got a problem with creating a textfile:
> how can I create a textfile, which has a headline like:
> 
> #data1
> 1 2 3 4 
> 5 6 7 8
> 
> the problem is, how to bind text and matrix, so that the 
> "read.table"-function will ignore the text and read the numbers.
> 
> Thank you for help
> Michael 
> 
> -- 
> 2
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list 
> https://www.stat.math.ethz.ch/mailman/listinfo> /r-help
> 

------------------------------------------------------------------------------
Notice: This e-mail message, together with any attachments, ...{{dropped}}

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to