Hi i have to table with IDs in each one. I want to make a join (as in sql) by the ID. Is any way to use the RODBC package (or other) in local tables (not a access, mysql, sql, etc. ) and made the join? Thanks in advance
On Tue, 28 Aug 2007, Jorge Cornejo Donoso wrote:> Hi i have to table with IDs in each one.And what is a 'table'? If these are data frames, see ?merge. If they are tables (which are arrays in R), then still use merge() if they can be converted to data frames.> I want to make a join (as in sql) by the ID. Is any way to use the RODBC > package (or other) in local tables (not a access, mysql, sql, etc. ) and > made the join?No, they use the DBMS to do the hard work. -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
>Hi i have to table with IDs in each one.>I want to make a join (as in sql) by the ID. Is any way to use the RODBC >package (or other) in local tables (not a access, mysql, sql, etc. ) ?and >made the join?With RODBC it would be normal SQL, so I guess with local tables you mean data frames? then look at ?merge best wishes ido
Jorge, I'm assuming that you mean dataframes of matrices. Then you could use merge to join both dataframes into a new one. See ?merge for more detail. HTH, Thierry ------------------------------------------------------------------------ ---- ir. Thierry Onkelinx Instituut voor natuur- en bosonderzoek / Research Institute for Nature and Forest Cel biometrie, methodologie en kwaliteitszorg / Section biometrics, methodology and quality assurance Gaverstraat 4 9500 Geraardsbergen Belgium tel. + 32 54/436 185 Thierry.Onkelinx op inbo.be www.inbo.be Do not put your faith in what statistics say until you have carefully considered what they do not say. ~William W. Watt A statistical analysis, properly conducted, is a delicate dissection of uncertainties, a surgery of suppositions. ~M.J.Moroney> -----Oorspronkelijk bericht----- > Van: r-help-bounces op stat.math.ethz.ch > [mailto:r-help-bounces op stat.math.ethz.ch] Namens Jorge Cornejo Donoso > Verzonden: dinsdag 28 augustus 2007 22:05 > Aan: r-help op stat.math.ethz.ch > Onderwerp: [R] sql query over local tables > > Hi i have to table with IDs in each one. > > I want to make a join (as in sql) by the ID. Is any way to > use the RODBC package (or other) in local tables (not a > access, mysql, sql, etc. ) and made the join? > > > > Thanks in advance > > ______________________________________________ > R-help op stat.math.ethz.ch 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. >
Jorge Cornejo Donoso wrote:> Hi i have to table with IDs in each one. > > I want to make a join (as in sql) by the ID. Is any way to use the RODBC > package (or other) in local tables (not a access, mysql, sql, etc. ) and > made the join?I guess you are looking for ?merge Uwe Ligges> > Thanks in advance > > ______________________________________________ > R-help at stat.math.ethz.ch 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.
I assume that by "local tables" you mean data frames in R. You can use the merge function in the base of R, as others have already mentioned, or if you want to use SQL syntax you can use the sqldf package. See example 4 on the sqldf home page: http://sqldf.googlecode.com On 8/28/07, Jorge Cornejo Donoso <jorgecornejo at uach.cl> wrote:> Hi i have to table with IDs in each one. > > I want to make a join (as in sql) by the ID. Is any way to use the RODBC > package (or other) in local tables (not a access, mysql, sql, etc. ) and > made the join? > > > > Thanks in advance > > ______________________________________________ > R-help at stat.math.ethz.ch 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. >