Hi all, I have two *.RData objects saveds in different time. They do have the same number of columns but different number of rows. I was trying to load and compare the two files by the first columns but face problem. t1=load(file="dat.RData") t2=load(file="dat256.RData") Error: object 'dat256' not found How do I fix this one and compare the two files? thank you in advance
Hello, 1) You don't need to do t1 = load(...), use just load(...). The objects saved in the file will be created with the same name they had when they were saved. 2) If the object dat256 was not found try file_dat256 <- file.choose() load(file = file_dat256) Hope this helps, Rui Barradas Em 19-11-2016 17:14, Val escreveu:> Hi all, > I have two *.RData objects saveds in different time. They do have the > same number of columns but different number of rows. I was trying to > load and compare the two files by the first columns but face problem. > > t1=load(file="dat.RData") > t2=load(file="dat256.RData") > Error: object 'dat256' not found > > How do I fix this one and compare the two files? > > thank you in advance > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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. >
But if save.image() was used with objects that have the same names then load will overwrite the object making comparing difficult. The solution to that is to use the envir argument to load your objects into distinct environments, as in [1]. [1] https://stat.ethz.ch/pipermail/r-help/2016-August/441077.html -- Sent from my phone. Please excuse my brevity. On November 19, 2016 9:53:34 AM PST, Rui Barradas <ruipbarradas at sapo.pt> wrote:>Hello, > >1) You don't need to do t1 = load(...), use just load(...). The objects > >saved in the file will be created with the same name they had when they > >were saved. >2) If the object dat256 was not found try > >file_dat256 <- file.choose() >load(file = file_dat256) > >Hope this helps, > >Rui Barradas > >Em 19-11-2016 17:14, Val escreveu: >> Hi all, >> I have two *.RData objects saveds in different time. They do have >the >> same number of columns but different number of rows. I was trying to >> load and compare the two files by the first columns but face problem. >> >> t1=load(file="dat.RData") >> t2=load(file="dat256.RData") >> Error: object 'dat256' not found >> >> How do I fix this one and compare the two files? >> >> thank you in advance >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> 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 at r-project.org mailing list -- To UNSUBSCRIBE and more, see >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.
... and in addition are the files in your current working directory? (see ?setwd) . If not you'll need a full path to the file. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Sat, Nov 19, 2016 at 9:14 AM, Val <valkremk at gmail.com> wrote:> Hi all, > I have two *.RData objects saveds in different time. They do have the > same number of columns but different number of rows. I was trying to > load and compare the two files by the first columns but face problem. > > t1=load(file="dat.RData") > t2=load(file="dat256.RData") > Error: object 'dat256' not found > > How do I fix this one and compare the two files? > > thank you in advance > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > 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.