Re: [R] advice requested re: building "good" system (R, SQL db) for handling large datasets

From: Dirk Eddelbuettel <edd_at_debian.org>
Date: Wed, 6 Feb 2008 09:58:56 -0600

On Wed, Feb 06, 2008 at 02:34:52PM +0200, Rainer M Krug wrote:
> R objects in blobs - I never thought about that. Could you elaborate on how
> to do something like that (I am using RMySQL)?

Look at help(serialize) -- any R object can be turned into a suitable representation, either binary (more efficient) or ascii (possibly 'safer').

Store that, retrieve it later, reconstruct the object and be merry :)

> tmpDf <- data.frame(a=1:10, b=LETTERS[1:10], c=rnorm(10))
> serDf <- serialize(tmpDf, NULL, ascii=TRUE)
> rm(tmpDf)
> head(unserialize(serDf))

  a b c

  1 1 A -0.6945820
  2 2 B -0.2960084
  3 3 C -0.2514302
  4 4 D -0.7318635
  5 5 E -0.1698489

  6 6 F 0.4331521
  >

Dirk

-- 
Three out of two people have difficulties with fractions.

______________________________________________
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 06 Feb 2008 - 16:06:23 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 Wed 06 Feb 2008 - 16:30:12 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.

list of date sections of archive