Sorry, Jeff, I misspoke:  the 'matrix' data.m is really a data frame -- I
was just thinking about it as a matrix since it's the numeric part of df1,
and didn't realize the thought made it's way in the message.   So the
memory issues are unrelated to converting between data frames and
matrices.  -David

On Fri, May 3, 2013 at 8:20 PM, Jeff Newmiller <jdnew...@dcn.davis.ca.us>wrote:

> I am not seeing any good justification in your description for converting
> to matrix if you are planning to convert it back to data frame. Memory is
> going to be inefficiently-used if you do this.
> ---------------------------------------------------------------------------
> Jeff Newmiller                        The     .....       .....  Go Live...
> DCN:<jdnew...@dcn.davis.ca.us>        Basics: ##.#.       ##.#.  Live
> Go...
>                                       Live:   OO#.. Dead: OO#..  Playing
> Research Engineer (Solar/Batteries            O.O#.       #.O#.  with
> /Software/Embedded Controllers)               .OO#.       .OO#.  rocks...1k
> ---------------------------------------------------------------------------
> Sent from my phone. Please excuse my brevity.
>
> David Romano <drom...@stanford.edu> wrote:
>
> >Hi everyone,
> >
> >I have large data frame, say df1,  with 165K columns, and all but the
> >first
> >four columns of df1 are numeric.   I transformed the numeric data and
> >obtained a matrix, call it data.m, with 165K - 4 columns, and then
> >tried to
> >create a second data frame by replacing the numeric columns of df1 by
> >data.m.  I did this in two ways, and both ways instantly used up all
> >the
> >available memory, so I was wondering whether there was a better way to
> >do
> >this.
> >
> >Here's what I tried:
> >
> >df2 <- df1
> >df2[ ,5:length(df1)] <- data.m
> >
> >and
> >
> >df2 <- cbind( df1[1:4], data.m)
> >
> >Thanks,
> >David
> >
> >       [[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.
>
> ______________________________________________
> 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.
>

        [[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