Re: [R] Java parser for R data file?

From: Prof Brian Ripley <ripley_at_stats.ox.ac.uk>
Date: Wed, 5 Dec 2007 17:15:31 +0000 (GMT)

On Wed, 5 Dec 2007, David Coppit wrote:

> Hi everyone,
>
> Has anyone written a parser in Java for either the ASCII or binary format
> produced by save()? I need to parse a single large 2D array that is
> structured like this:
>
> list(
> "32609_1" = c(-9549.39231289146, -9574.07159324482, ... ),
> "32610_2" = c(-6369.12526971635, -6403.99620977124, ... ),
> "32618_2" = c(-2138.29095689061, -2057.9229403233, ... ),
> ...
> )
>
> Or, given that I'm dealing with just a single array, would it be better to
> roll my own I/O using write.table or write.matrix from the MASS package?

It would be much easier. The save() format is far more complex than you need. However, I would use writeBin() to write a binary file and read that in in Java, avoiding the binary -> ASCII -> binary conversion.

-- 
Brian D. Ripley,                  ripley_at_stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help_at_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.
Received on Wed 05 Dec 2007 - 17:19:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 06 Dec 2007 - 21:30:17 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.