I got two .RData file e.g data.2005.RData & data.2006.RData I would like to combine these two different data set and make single RData file. in both file there are some NULL files are also available and I would like to clear this NULL files also. $ : NULL $ : NULL $ : num [1:43285, 1:8] -21.1 -21.1 -24.9 -24.9 -24.9 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ... $ : num [1:44730, 1:8] 5.74 5.74 5.74 -21.06 -21.06 ... ..- attr(*, "dimnames")=List of 2 .. ..$ : NULL .. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ... I never worked with RData files, so it will be very nice if somebody can help me to do this operation. -- View this message in context: http://r.789695.n4.nabble.com/add-data-from-RData-file-tp4453981p4453981.html Sent from the R help mailing list archive at Nabble.com.
You can use load() to load them both, if they do not have objects with identical names, then save() to make a new RData file. I'm not clear on what you mean by a NULL file, though. If you know which objects you want to get rid of, you can do that with rm(). Sarah On Wed, Mar 7, 2012 at 12:46 PM, uday <uday_143_4u at hotmail.com> wrote:> I got two .RData file e.g data.2005.RData & data.2006.RData > I would like to combine these two different data set and make single RData > file. > in both file there are some NULL files are also available and I would like > to clear this NULL files also. > $ : NULL > ?$ : NULL > ?$ : num [1:43285, 1:8] -21.1 -21.1 -24.9 -24.9 -24.9 ... > ?..- attr(*, "dimnames")=List of 2 > ?.. ..$ : NULL > ?.. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ... > ?$ : num [1:44730, 1:8] 5.74 5.74 5.74 -21.06 -21.06 ... > ?..- attr(*, "dimnames")=List of 2 > ?.. ..$ : NULL > ?.. ..$ : chr [1:8] "latitude" "longitude" "time" "ch4" ... > > I never worked with RData files, so it will be very nice if somebody can > help me to do this operation. > > ---- Sarah Goslee http://www.functionaldiversity.org
HI Sarah, thanks for reply your method works what I did load (" data.2005") load ( "data.2006") then data.new<- c( data.2005, data.2006) or we can save it as a new .RData also. The NULL files I can remove by selecting particular file number e.g data.new<- c( data.2005[1:3], data.2006[4:6]) cheers Uday -- View this message in context: http://r.789695.n4.nabble.com/add-data-from-RData-file-tp4453981p4454461.html Sent from the R help mailing list archive at Nabble.com.
On Mar 7, 2012, at 3:16 PM, uday wrote:> HI Sarah, thanks for reply > > your method works > > what I did > load (" data.2005") > load ( "data.2006") > then > data.new<- c( or we can save it as a new .RData also.That looks failure prone. You have removed the context of your original question ( and PLEASE stop doing that despite the fact that the Nabble interface leads to to think that the rest of us see it) .... but I seem to remember that you had the same number of columns, so: data.new <- cbind ( data.2005, data.2006 ) save(data.new, file="data.new.RData")> > > The NULL files I can remove by selecting particular file number > e.g data.new<- c( data.2005[1:3], data.2006[4:6]) >-- David Winsemius, MD West Hartford, CT
On Mar 7, 2012, at 3:39 PM, David Winsemius wrote:> > On Mar 7, 2012, at 3:16 PM, uday wrote: > >> HI Sarah, thanks for reply >> >> your method works >> >> what I did >> load (" data.2005") >> load ( "data.2006") >> then >> data.new<- c( or we can save it as a new .RData also. > > That looks failure prone. You have removed the context of your > original question ( and PLEASE stop doing that despite the fact that > the Nabble interface leads to to think that the rest of us see > it) .... but I seem to remember that you had the same number of > columns, so: > > data.new <- cbind ( data.2005, data.2006 )^^^^^^^ I meant to suggest rbind( )> save(data.new, file="data.new.RData") > >> >> >> The NULL files I can remove by selecting particular file number >> e.g data.new<- c( data.2005[1:3], data.2006[4:6]) >>David Winsemius, MD West Hartford, CT