Hi,

On Thursday, April 18, 2013, cmk087 wrote:

> I am trying to write a 10000x8 matrix into a text file so I can read it
> into
> SAS.
> When I tried using write.table I could not get just 8 columns and 10000
> rows
> it would just write all the data in a line until it hit the end and went to
> the next line.


This doesn't make any sense to me. Can you give us the code you used, the
output of str() on your data, and ideally a small bit of your data using
dput(head(yourdata, 20)) please?

If you want a text file, then write.table () is the appropriate tool, but
we can't tell what went wrong without more information.



> I tried instead using write.foreign and I got an error message: Error in if
> (varnames[v] != names(varnames)[v]) cat("LABEL ", varnames[v],  :
>   argument is of length zero
>
> I do not want any variable names at all I just want the data in a text file
> with 8 columns and 10000 rows. The code I used was: write.foreign(T1,
> "time1.txt", "time1.sas",   package="SAS").
>
> Is there any way in which I can write the matrix as is in a text (or csv)
> file without having any variable names?
>
> Sarah


-- 
Sarah Goslee
http://www.stringpage.com
http://www.sarahgoslee.com
http://www.functionaldiversity.org

        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to