[R] [Fwd: adding more columns in big.matrix object of bigmemory package]

utkarshsinghal utkarsh.singhal at global-analytics.com
Fri Dec 17 08:16:52 CET 2010


   Hi,
   With reference to the mail below, I have large datasets, coming from various
   different sources, which I can read into filebacked big.matrix using library
   bigmemory. I want to merge them all into one 'big.matrix' object. (Later, I
   want to run regression using library 'biglm').
   I am unsuccessfully trying to do this from quite some time now. Can you
   please suggest some way? Am I missing some already available function?
   Even a functionality of the following will work for me:
     * Just  appending more columns in an existing big.matrix object (not
       merging).
     * If the individual datasets are small enough to be read in usual R, just
       the combined dataset is huge.

   Any thoughts are welcome.
   Thanks,
   Utkarsh
   -------- Original Message --------

   Subject: adding more columns in big.matrix object of bigmemory package
      Date: Thu, 16 Dec 2010 18:29:38 +0530
      From: utkarshsinghal [1]<utkarsh.singhal at global-analytics.com>
        To: r help [2]<r-help at stat.math.ethz.ch>

   Hi all,
   Is there any way I can add more columns to an existing filebacked big.matrix
   object.
   In general, I want a way to modify an existing big.matrix object, i.e., add
   rows/columns, rename colnames, etc.
   I tried the following:
   > library(bigmemory)
   > x =
   read.big.matrix("test.csv",header=T,type="double",shared=T,backingfile="test
   .backup",descriptorfile="test.desc")
   > x[,"v4"] = "new"
   Error in mmap(j, colnames(x)) :
     Couldn't find a match to one of the arguments.
   (The above functionality is presently there in usual data.frames in R.)
   Thanks in advance,
   Utkarsh

References

   1. mailto:utkarsh.singhal at global-analytics.com
   2. mailto:r-help at stat.math.ethz.ch


More information about the R-help mailing list