Re: [R] sql query over local tables

2007-08-29 Thread Gabor Grothendieck
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 <[EMAIL PROTECTED]> 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@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.
>

__
R-help@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.


Re: [R] sql query over local tables

2007-08-29 Thread Uwe Ligges


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@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.

__
R-help@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.


Re: [R] sql query over local tables

2007-08-29 Thread ONKELINX, Thierry
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
[EMAIL PROTECTED]
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: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] Namens Jorge Cornejo Donoso
> Verzonden: dinsdag 28 augustus 2007 22:05
> Aan: r-help@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@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.
>

__
R-help@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.


Re: [R] sql query over local tables

2007-08-29 Thread Ido M. Tamir
>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

__
R-help@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.


Re: [R] sql query over local tables

2007-08-29 Thread Prof Brian Ripley
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,  [EMAIL PROTECTED]
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, UKFax:  +44 1865 272595

__
R-help@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.


[R] sql query over local tables

2007-08-28 Thread Jorge Cornejo Donoso
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@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.