[R] Writing output into a file

Rui Barradas rui1174 at sapo.pt
Mon Feb 13 14:23:49 CET 2012


Hello,

> I tried writing this data into a file using the save(myList,
> file="test1.bin") command, but unfortunately, the numerical values seem
> to get garbled when I do so.
>
> The numbers in my RGui look like
>
> 0, 0.5, 0, 1 etc. etc.
>
> But when I stored it into a .bin file, and retrieved it using java code,
> it returns data such as,
>

The problem should be in the use of java, 'save' uses a R format , RDA.
You can use 'ascii=TRUE'and see it with a text editor. Also see

?save

> I also tried the second method (using a # Open a file connection)
>
> Unfortunately, here too the data gets extremely garbled.

Don't understand why, check the output file with a text editor and let us
know
what is wrong.

The problem I've seen is that the use of 'strsplit' coerses the numeric data
to character,
but this is easy to solve.

Does your list have sub-lists?

Rui Barradas

--
View this message in context: http://r.789695.n4.nabble.com/Writing-output-into-a-file-tp4382243p4383741.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list