Re: [R] SQL and R

2024-12-12 Thread akshay kulkarni
Dear Gabor, THanks a lot THanking you, Yours sincerely, AKSHAY M KULKARNI From: Gabor Grothendieck Sent: Thursday, December 12, 2024 7:39 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] SQL and R The advantages of SQL

Re: [R] SQL and R

2024-12-12 Thread Gabor Grothendieck
The advantages of SQL are that - it can be used from many languages so if you know SQL you can easily move that part of your code to python, say, and visa versa - it is widely used - it can handle data stored outside of R and possibly otherwise too large for R - some SQL databases support multiple

Re: [R] SQL and R

2024-12-12 Thread akshay kulkarni
From: R-help on behalf of Eberhard W Lisse Sent: Thursday, December 12, 2024 2:53 AM To: r-help@r-project.org Subject: Re: [R] SQL and R Looks like an assignment question. If so, do your homework yourself. Google is your friend el On 2024-12-11 15:16, akshay kulkarni wrote: > dear Memb

Re: [R] SQL and R

2024-12-12 Thread akshay kulkarni
...@gmail.com ; Ben Bolker Subject: Re: [R] SQL and R And to answer the dependency question. Neither is dependent on the other. But both can be complimentary. If you consider that SQL*may* be a route to accessing your data (if it's in a database). And R *may* be a route to analysis of the

Re: [R] SQL and R

2024-12-12 Thread akshay kulkarni
imore, MD 21201-1524 Cell phone 443-418-5382 From: R-help on behalf of akshay kulkarni Sent: Wednesday, December 11, 2024 8:16 AM To: R help Mailing list Subject: [R] SQL and R dear Members, I have recently started studyin

Re: [R] SQL and R - tangential

2024-12-12 Thread akshay kulkarni
Dear JC, THanks . THanking you, Yours sincerely, AKSHAY M KULKARNI From: R-help on behalf of J C Nash Sent: Wednesday, December 11, 2024 10:27 PM To: r-help@r-project.org Subject: Re: [R] SQL and R - tangential My late friend Morven

Re: [R] SQL and R

2024-12-12 Thread akshay kulkarni
Dear Bert, THanks a lot From: Bert Gunter Sent: Wednesday, December 11, 2024 9:25 PM To: akshay kulkarni Cc: R help Mailing list Subject: Re: [R] SQL and R Just a slight technical note -- Ben gave you a good answer already, imo. The note is

Re: [R] SQL and R

2024-12-11 Thread Jeff Newmiller via R-help
Some people prefer SQL syntax. Also, SQL implementations are generally intrinsically linked with persistent disk storage, so it works straightforwardly with data sets larger than RAM. Finally, most implementations support shared access to the data from multiple clients. A long time ago in a com

Re: [R] SQL and R

2024-12-11 Thread CALUM POLWART
; 10 North Greene Street > <https://www.google.com/maps/search/10+North+Greene+Street?entry=gmail&source=g> > GRECC (BT/18/GR) > Baltimore, MD 21201-1524 > Cell phone 443-418-5382 > > > > > > From: R-help on behalf

Re: [R] SQL and R

2024-12-11 Thread Sorkin, John
18/GR) Baltimore, MD 21201-1524 Cell phone 443-418-5382 From: R-help on behalf of akshay kulkarni Sent: Wednesday, December 11, 2024 8:16 AM To: R help Mailing list Subject: [R] SQL and R dear Members, I have recently started stu

Re: [R] SQL and R

2024-12-11 Thread Eberhard W Lisse
Looks like an assignment question. If so, do your homework yourself. Google is your friend el On 2024-12-11 15:16, akshay kulkarni wrote: > dear Members, I have recently started studying SQL and MySQL. My > question is, what exactly is SQL used for? That is, whatever can be > done by SQL, like

Re: [R] SQL and R - tangential

2024-12-11 Thread avi.e.gross
8 AM To: r-help@r-project.org Subject: Re: [R] SQL and R - tangential My late friend Morven Gentleman, not long after he stepped down from being chair of Computer Science at Waterloo, said that it seemed computer scientists had to create a new computer language for every new problem they encounter

Re: [R] SQL and R - tangential

2024-12-11 Thread J C Nash
To: R help Mailing list Subject: [R] SQL and R dear Members, I have recently started studying SQL and MySQL. My question is, what exactly is SQL used for? That is, whatever can be done by SQL, like subsetting and filtering of data sets, can also be done by R. What&#x

Re: [R] SQL and R

2024-12-11 Thread avi.e.gross
sions of SQL have been tuned over decades ... -Original Message- From: R-help On Behalf Of akshay kulkarni Sent: Wednesday, December 11, 2024 8:17 AM To: R help Mailing list Subject: [R] SQL and R dear Members, I have recently started studying SQL and MySQ

Re: [R] SQL and R

2024-12-11 Thread Bert Gunter
Just a slight technical note -- Ben gave you a good answer already, imo. The note is: R is Turing complete, which mean that *anything* any language can do, R could be programmed to do also. The point is what can be done well in R and what can be done (often much) better with other tools, as Ben ex

Re: [R] SQL and R

2024-12-11 Thread Ben Bolker
Others may know more than I do, but roughly: (1) SQL provides access to relational database management systems that are much more robust and handle large-scale data; (2) methods based on SQL will often handle data that are too large to fit in memory R complements SQL by providing a mu

[R] SQL and R

2024-12-11 Thread akshay kulkarni
dear Members, I have recently started studying SQL and MySQL. My question is, what exactly is SQL used for? That is, whatever can be done by SQL, like subsetting and filtering of data sets, can also be done by R. What's, then, the advantage of SQL? It is OK if you ta

Re: [R] SQL Database

2018-07-26 Thread MacQueen, Don via R-help
work now on the right drivers that might be appropriate for centos, but if anyone happens to know, hints are appreciated Harold -Original Message- From: MacQueen, Don [mailto:macque...@llnl.gov] Sent: Thursday, July 26, 2018 11:26 AM To: Doran, Harold ; '

Re: [R] SQL Database

2018-07-26 Thread Doran, Harold
anyone happens to know, hints are appreciated Harold -Original Message- From: MacQueen, Don [mailto:macque...@llnl.gov] Sent: Thursday, July 26, 2018 11:26 AM To: Doran, Harold ; 'r-help@r-project.org' Subject: Re: [R] SQL Database From my point of view, the logic is thi

Re: [R] SQL Database

2018-07-26 Thread MacQueen, Don via R-help
From my point of view, the logic is this: If the external database is Oracle, use ROracle If the external database is MySQL, use RMySQL and similarly for other databases If there is no R package specific to the database, then you drop back to RODBC or RJDBC. Hopefully you can get the necessa

Re: [R] SQL Database

2018-07-26 Thread Martin Maechler
> Doran, Harold > on Wed, 25 Jul 2018 14:57:13 + writes: > I'm doing some work now to learn which SQL database > package is the most optimal for the task I am working on. Hmm... we would have a problem with optimize() and optim() if this was optimal << more optima

Re: [R] SQL Database

2018-07-25 Thread Bert Gunter
https://rviews.rstudio.com/2017/10/18/database-queries-with-r/ Cheers, 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 Wed, Jul 25, 2018 at 7:57 AM, Dora

[R] SQL Database

2018-07-25 Thread Doran, Harold
I'm doing some work now to learn which SQL database package is the most optimal for the task I am working on. There are many packages, and I'm reviewing the documentation on some of them now. I am seeking advice from those of you who might suggest a package to use for the task I am currently wor

Re: [R] SQL Server "float" is not handled by RODBC -- Is there a workaround?

2015-10-15 Thread Mark Dalphin
Hi Jim, Yes, your Java versions need to match bit width. As for drivers, I do not use the Microsoft one; it used to be hard to obtain for Linux users; I don't know if it still is. I currently use "jtds" from Sourceforge: http://jtds.sourceforge.net/ >From their site: > jTDS is an open source

Re: [R] SQL Server "float" is not handled by RODBC -- Is there a workaround?

2015-10-15 Thread jim holtman
Mark, Thanks for the suggestion. I will have to look into that option. I assume that if I am running on a 64-bit system, I also have to use the 64-bit version of Java. We have had some problems in the past because the company standard is a 32-bit version of Java and we had to also load in the 6

Re: [R] SQL Server "float" is not handled by RODBC -- Is there a workaround?

2015-10-15 Thread Mark Dalphin
Hi Jim, No answers over the course of 24 hours so I'll give it a shot. First, I always work under Linux, so my answers may well be worthless for your Windows scenario. Second, I don't know if my workaround works as I don't actually have a SQL Server DB using float. Now the workaround: I have h

[R] SQL Server "float" is not handled by RODBC -- Is there a workaround?

2015-10-14 Thread jim holtman
Here is the system I am using: = > sessionInfo() R version 3.2.2 (2015-08-14) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 7 x64 (build 7601) Service Pack 1 locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.125

[R] SQL Requests Templating

2014-10-29 Thread Alexander Myltsev
Hi, I am new to R. What I'd like to know is how to empower sqldf with templates like https://www.playframework.com/documentation/2.3.x/ScalaAnorm does? What does seasoned R-hacker use for this purpose: dedicated R-package that I am not aware of, or kind of format string, or something else? A.

Re: [R] SQL vs R

2014-05-21 Thread Dr Eberhard Lisse
So, some feedback. Have installed MariaDB 10.0.10 on the Linux box. That speeded things up. Changed from InnoDB/XtraDb to Aria. That speeded loading of the data up. Have installed MariaDB on the iMac. That speeded things up more. Tried to tune MariadDB's config. Didn't speed things up much, but f

Re: [R] SQL vs R

2014-05-06 Thread Thomas Lumley
On Wed, May 7, 2014 at 2:21 AM, David R Forrest wrote: > It sounds as if your underlying MySQL database is too slow for your purposes. > Whatever you layer on top of it will be constrained by the underlying > database. To speed up the process significantly, you may need to do work on > the da

Re: [R] SQL vs R

2014-05-06 Thread Bert Gunter
I believe this discussion should be taken offlist as it no longer seems to be concerned with R. -- Bert Gunter Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." H. Gilbert Welch On Tu

Re: [R] SQL vs R

2014-05-06 Thread Peter Crowther
The dataset is not large by database standards. Even in mySQL - not known for its speed at multi-row querying - the queries you describe should complete within a few seconds on even moderately recent hardware if your indexes are reasonable. What are your performance criteria for processing these

Re: [R] SQL vs R

2014-05-06 Thread Dr Eberhard Lisse
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Exactly, which is why I am looking for something faster :-)-O el on 2014-05-06, 15:21 David R Forrest said the following: > It sounds as if your underlying MySQL database is too slow for your > purposes. Whatever you layer on top of it will be cons

Re: [R] SQL vs R

2014-05-06 Thread David R Forrest
It sounds as if your underlying MySQL database is too slow for your purposes. Whatever you layer on top of it will be constrained by the underlying database. To speed up the process significantly, you may need to do work on the database backend part of the process. Dave On May 6, 2014, at 7

Re: [R] SQL vs R

2014-05-06 Thread Dr Eberhard Lisse
Thanks, tried all of that, too slow. el on 2014-05-06, 12:00 Gabor Grothendieck said the following: > On Tue, May 6, 2014 at 5:12 AM, Dr Eberhard Lisse wrote: >> Jeff >> >> It's in MySQL, at the moment roughly 1.8 GB, if I pull it into a >> dataframe it saves to 180MB. I work from the dataframe

Re: [R] SQL vs R

2014-05-06 Thread Gabor Grothendieck
On Tue, May 6, 2014 at 5:12 AM, Dr Eberhard Lisse wrote: > Jeff > > It's in MySQL, at the moment roughly 1.8 GB, if I pull it into a > dataframe it saves to 180MB. I work from the dataframe. > > But, it's not only a size issue it's also a speed issue and hence I > don't care what I am going to use

Re: [R] SQL vs R

2014-05-06 Thread Dr Eberhard Lisse
David, this is quite slow :-)-O el on 2014-05-06, 10:55 David McPearson said the following: [...] > It seems like you are trying to extract a (relatively) small data set from a > much larger SQL databaseWhy not do the SQL stiff in the database and the > analysis *statsm graphics...) in R? Maybe

Re: [R] SQL vs R

2014-05-06 Thread David McPearson
On Tue, 6 May 2014 10:12:50 +0100 Dr Eberhard Lisse wrote > Jeff > > It's in MySQL, at the moment roughly 1.8 GB, if I pull it into a > dataframe it saves to 180MB. I work from the dataframe. > > But, it's not only a size issue it's also a speed issue and hence I > don't care what I am going to

Re: [R] SQL vs R

2014-05-06 Thread Carlos Ortega
Hi, Yes dplyr syntax is quite equivalent to SQL, although it is faster. Another alternative you could consider is to use *data.table* which has a syntax very similar to the way you select subset within a data.frame and in terms of performance is faster (a bit) than sqldf. You can get some idea of

Re: [R] SQL vs R

2014-05-06 Thread Dr Eberhard Lisse
Jeff It's in MySQL, at the moment roughly 1.8 GB, if I pull it into a dataframe it saves to 180MB. I work from the dataframe. But, it's not only a size issue it's also a speed issue and hence I don't care what I am going to use, as long as it is fast. sqldf is easy to understand for me but it ta

Re: [R] SQL vs R

2014-05-06 Thread Jeff Newmiller
In what format is this "growing" data stored? CSV? SQL? Log textfile? You say you don't want to use sqldf, but you haven't said what you do want to use. --- Jeff NewmillerThe . . Go L

Re: [R] SQL vs R

2014-05-06 Thread Eberhard Lisse
Thank you. My requirements are that simple. One table, 11 fields, of which 3 are interesting, 30 Million records, growing daily by between 30. And, yes I have spent an enormous amount of time reading these things, but for someone not dealing with this professionally and/or on a daily basis, t

Re: [R] SQL vs R

2014-05-05 Thread Gabor Grothendieck
On Fri, May 2, 2014 at 5:23 PM, Dr Eberhard Lisse wrote: > Hi, > > How do I do something like this without using sqldf? > > a <- sqldf("SELECT COUNT(*) FROM b WHERE c = 'd'") > > or > > e <- sqldf("SELECT f, COUNT(*) FROM b GROUP BY f ORDER BY f") > In the examples section at the bottom of ?sqldf

Re: [R] SQL vs R

2014-05-05 Thread David Winsemius
On May 5, 2014, at 11:44 AM, Dr Eberhard Lisse wrote: > I do not wish to prolong this metadiscussion but I remain confused > by your advice: > > 1) You don't understand what I asked (ie would have to parse two > simple SQL statements) Correct ... at least for me. I could have guessed at what th

Re: [R] SQL vs R

2014-05-03 Thread David Winsemius
intent didn't seem justified by the level of courtesy offered by the questioner. -- David. > > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf Of Bert Gunter > Sent: Saturday, May 03, 2014 1:12 AM > To: D

Re: [R] SQL vs R

2014-05-03 Thread Jeff Newmiller
?table ?aggregate Also, packages plyr, data.table, and dplyr. You might consider reading [1], but if your interests are really as simple as your examples then the table function should be sufficient. That function is discussed in the Introduction to R document that you really should have read b

Re: [R] SQL vs R

2014-05-03 Thread Satish Anupindi Rao
1:12 AM To: Dr Eberhard Lisse Cc: r Subject: Re: [R] SQL vs R By making the effort to learn R? See e.g. the "Introduction to R" tutorial that ships with R. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not kn

Re: [R] SQL vs R

2014-05-03 Thread Rolf Turner
On 04/05/14 09:58, Sarah Goslee wrote: Personally, I'm not sure how much work someone who appears to have not read the posting guide should really expect the list to do on his behalf. But snarky replies to reasonable requests to read the documentation are easier than doing one's own work. We

Re: [R] SQL vs R

2014-05-03 Thread Rolf Turner
On 04/05/14 10:16, Dr Eberhard W Lisse wrote: Google Pressdram :-)-O el On 2014-05-03, 23:42 , Rolf Turner wrote:> On 04/05/14 00:05, Dr Eberhard W Lisse wrote: Thank you very much, Mr Arkell. I don't get it. Can anyone explain the (joke? allusion?) ? Thank you. cheers, Rolf Turner _

Re: [R] SQL vs R

2014-05-03 Thread Dr Eberhard W Lisse
Google Pressdram :-)-O el On 2014-05-03, 23:42 , Rolf Turner wrote:> > On 04/05/14 00:05, Dr Eberhard W Lisse wrote: > >> Thank you very much, Mr Arkell. > > I don't get it. Can anyone explain the (joke? allusion?) ? > > cheers, > > Rolf Turner > __ R

Re: [R] SQL vs R

2014-05-03 Thread Sarah Goslee
On Sat, May 3, 2014 at 5:42 PM, Rolf Turner wrote: > > On 04/05/14 00:05, Dr Eberhard W Lisse wrote: > >> Thank you very much, Mr Arkell. > > > I don't get it. Can anyone explain the (joke? allusion?) ? I believe it's a moderately offensive reply from someone who feels unfairly dismissed, derive

Re: [R] SQL vs R

2014-05-03 Thread Rolf Turner
On 04/05/14 00:05, Dr Eberhard W Lisse wrote: Thank you very much, Mr Arkell. I don't get it. Can anyone explain the (joke? allusion?) ? cheers, Rolf Turner On 2014-05-03, 07:11 , Bert Gunter wrote: By making the effort to learn R? See e.g. the "Introduction to R" tutorial that ships w

Re: [R] SQL vs R

2014-05-03 Thread Dr Eberhard W Lisse
Thanks, will try to figure this out :-)-O el On 2014-05-03, 06:40 , Carlos Ortega wrote: > Hi, > > With the new package "dplyr" you can create equivalent SQL sintaxt > queries like the one you need. > You can find examples of how to apply it here: > > http://martinsbioblogg.wordpress.com/2014/

Re: [R] SQL vs R

2014-05-03 Thread Dr Eberhard W Lisse
Thank you very much, Mr Arkell. el On 2014-05-03, 07:11 , Bert Gunter wrote: > By making the effort to learn R? > > See e.g. the "Introduction to R" tutorial that ships with R. > > -- Bert > > Bert Gunter > Genentech Nonclinical Biostatistics > (650) 467-7374 > > "Data is not information. Inf

Re: [R] SQL vs R

2014-05-02 Thread Bert Gunter
By making the effort to learn R? See e.g. the "Introduction to R" tutorial that ships with R. -- Bert Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374 "Data is not information. Information is not knowledge. And knowledge is certainly not wisdom." H. Gilbert Welch On Fri, May 2

Re: [R] SQL vs R

2014-05-02 Thread Carlos Ortega
Hi, With the new package "dplyr" you can create equivalent SQL sintaxt queries like the one you need. You can find examples of how to apply it here: http://martinsbioblogg.wordpress.com/2014/03/26/using-r-quickly-calculating-summary-statistics-with-dplyr/ http://martinsbioblogg.wordpress.com/201

[R] SQL vs R

2014-05-02 Thread Dr Eberhard Lisse
Hi, How do I do something like this without using sqldf? a <- sqldf("SELECT COUNT(*) FROM b WHERE c = 'd'") or e <- sqldf("SELECT f, COUNT(*) FROM b GROUP BY f ORDER BY f") greetings, el __ R-help@r-project.org mailing list https://stat.ethz.ch/mail

Re: [R] SQL queries in R

2013-06-07 Thread andrija djurovic
myconn<-odbcConnect("testdata") sql.select<-paste("select UNIT_ID from UNITS where (UNIT_TYPE='",unit,"' and COMMUNITY='",property,"')",sep="") unit_ids<-sqlQuery(myconn,sql.select,as.is=TRUE) This should works if myconn and sql.select are defined properly Andrija On Jun 7, 2013 9:58 PM, "Sneha

Re: [R] SQL queries in R

2013-06-07 Thread Sneha Bishnoi
tried as.is ,gives an error, [1] "01000 10054 [Microsoft][ODBC SQL Server Driver][DBNETLIB]ConnectionWrite (send())." [2] "[RODBC] ERROR: Could not SQLExecDirect 'select UNIT_ID from UNITS where (UNIT_TYPE='1X1' and COMMUNITY='SAN1193')'" On Fri, Jun 7, 2013 at 3:21 PM, andrija djurovic wrote:

Re: [R] SQL queries in R

2013-06-07 Thread andrija djurovic
?sqlQuery as.is - argument Andrija On Jun 7, 2013 9:10 PM, "Sneha Bishnoi" wrote: > Hey all! > > I am trying to select a bunch of id's (data type -character) from a table > and store them in a variable in R > But when i do this, it automatically truncates the leading zero's in id's > even though

[R] SQL queries in R

2013-06-07 Thread Sneha Bishnoi
Hey all! I am trying to select a bunch of id's (data type -character) from a table and store them in a variable in R But when i do this, it automatically truncates the leading zero's in id's even though they are of character type. code is :- >myconn<-odbcConnect("testdata") >sql.select<-paste("

Re: [R] [SQL]

2013-04-25 Thread Jeff Newmiller
The format of files with a SQL extension are not necessarily well- defined. In most cases I have found, they are text files that contain SQL Data Definition Language statements (CREATE TABLE) and possibly Data Manipulation Language statements (INSERT INTO). You may be able to extract the portion

Re: [R] [SQL]

2013-04-25 Thread MacQueen, Don
With so little information, one can only guess. I would guess your .sql files contain "scripts" written in the SQL language, in which case you will need some local database support to help you run those scripts in whatever database has the data. Perhaps the scripts will output csv files. If it tu

[R] [SQL]

2013-04-25 Thread Ignacio Martinez
Hi, The data for my new project are in a bunch of .sql files, instead of the clasic csv files that I'm used to work with. Could someone explain to me how to read these files into R? Thanks, -Ignacio [[alternative HTML version deleted]] __ R-

Re: [R] SQL via RODBC

2012-10-26 Thread Jeff Newmiller
That would be very implementation-specific, and ODBC is generic in its own way. No, you must run one query at a time in general, and deal with the results using the procedural language. Keep in mind that you have to pick a back-end database to work with, and for creating the database you may ha

[R] SQL via RODBC

2012-10-26 Thread Dr. Alireza Zolfaghari
Hi list, Is there a way to use sqlQuery function where there is a sql file (ie. sample.sql)? I just want to mention that in my sql file there are some comment lines (starting with --). This means that if I paste all the lines in the sql file, I'll come up with a long string that most part of it is

Re: [R] SQL query with Multicore option on R -linux

2012-09-21 Thread Heramb Gadgil
This is what I think; Hive internally distributes the data. If you have set up Hive on single core it will fetch the query results from that core. If you have multi-core system on which you have setup the Hive, it will search all the cores for the query submitted and results would be compiled toge

[R] SQL query with Multicore option on R -linux

2012-09-20 Thread Madana_Babu
Hi all, I have the following sql query that I am executing on a machine with single core. I want to know how can I execute the same sqery on a maching that is running with 4 cores. Please provide me the code. NEW_TABLE <- rhive.query("SELECT A, B, COUNT(C) FROM TABLE_A WHERE A>='01-01-2012'")

[R] SQL query with multicore option

2012-09-14 Thread Madana_Babu
Hi all, I have the following sql query that I am executing on a machine with single core. I want to know how can I execute the same sqery on a maching that is running with 4 cores. Please provide me the code. NEW_TABLE <- rhive.query("SELECT A, B, COUNT(C) FROM TABLE_A WHERE A>='01-01-2012'") Al

Re: [R] SQL> select ... where "R variable"

2011-12-14 Thread Gabor Grothendieck
On Wed, Dec 14, 2011 at 7:04 AM, agent dunham wrote: > Thank you, > > I guess it didn't work for me, maybe is not possible? > > I've tried: > >> con<- odbcDriverConnect("Driver=SQL Server; >> Server=...\\...;Database=...;Uid=...;Pwd=... ;") > >> v1=sqlQuery(con, "select v1 from sqltable where v3 =

Re: [R] SQL> select ... where "R variable"

2011-12-14 Thread agent dunham
Thank you, I guess it didn't work for me, maybe is not possible? I've tried: > con<- odbcDriverConnect("Driver=SQL Server; > Server=...\\...;Database=...;Uid=...;Pwd=... ;") > v1=sqlQuery(con, "select v1 from sqltable where v3 =cte and v2 in (select > v2 from R_dataframe) order by (select v2

Re: [R] SQL> select ... where "R variable"

2011-12-13 Thread Gabor Grothendieck
On Tue, Dec 13, 2011 at 10:54 AM, agent dunham wrote: > Before loading sql packages, i was wondering, once all packages required are > installed, if  it's possible to do from R console sth like this: > > SQL> select v1 from sql_table >        where v2 in ("R_variable")  # being "R_variable" a vect

[R] SQL> select ... where "R variable"

2011-12-13 Thread agent dunham
Before loading sql packages, i was wondering, once all packages required are installed, if it's possible to do from R console sth like this: SQL> select v1 from sql_table where v2 in ("R_variable") # being "R_variable" a vector Thanks in advance, u...@host.com -- View this message in

Re: [R] SQL Changing Data Type

2011-06-24 Thread Gabor Grothendieck
On Fri, Jun 24, 2011 at 4:12 PM, GL wrote: > Passing in two dates to a sql statement (sqldf). Is returning a factor. Tried > setting back to a Date via as.Date, but get an error the error: character > string is not in a standard unambiguous format. Any thoughts appreciated. > > Code/Results listed

Re: [R] SQL Changing Data Type

2011-06-24 Thread Dennis Murphy
Hi: str() probably would have been more informative than summary(), but if the date is a factor, perhaps this will help: as.Date(as.character(Date), format = '%Y-%m-%d') Including the format argument is usually safer than letting the function try to figure it out on its own. Neglecting to includ

[R] SQL Changing Data Type

2011-06-24 Thread GL
Passing in two dates to a sql statement (sqldf). Is returning a factor. Tried setting back to a Date via as.Date, but get an error the error: character string is not in a standard unambiguous format. Any thoughts appreciated. Code/Results listed below: > summary(df.possible.combos) Date

Re: [R] Decimals in R/SQL

2011-04-13 Thread Seth Falcon
On Wed, Apr 13, 2011 at 1:34 PM, Rachel Licata wrote: > Thanks again Jim - that is really helpful and I apologize that I am > new to R.  How can I convert to numeric in SQL and when I am working > on a table in a database?  The file is huge so that is why I am > using SQL and the database to work

Re: [R] Decimals in R/SQL

2011-04-13 Thread Gabor Grothendieck
On Wed, Apr 13, 2011 at 4:34 PM, Rachel Licata wrote: > Thanks again Jim - that is really helpful and I apologize that I am new to R. >  How can I convert to numeric in SQL and when I am working on a table in a > database?  The file is huge so that is why I am using SQL and the database to > wo

Re: [R] Decimals in R/SQL

2011-04-13 Thread Rachel Licata
holtman [mailto:jholt...@gmail.com] Sent: Wednesday, April 13, 2011 12:52 PM To: Rachel Licata Cc: r-help@r-project.org Subject: Re: [R] Decimals in R/SQL The problem is that you data is 'integer' and I assume that the database is keeping everything integer. You can do what you are

Re: [R] Decimals in R/SQL

2011-04-13 Thread jim holtman
y( connSQLite , "select ST, > SUM(AGEP*PWGTP)*1.0/SUM(PWGTP)*1.00 as wgtage from ss09 > group by ST") > > ST   wgtage > 1   1 37.57083 > 2   2 33.94322 > 3   4 36.14499 > 4   5 37.51233 > 5   6 35.65581 > > -Original Message- >

Re: [R] Decimals in R/SQL

2011-04-13 Thread Rachel Licata
age- From: jim holtman [mailto:jholt...@gmail.com] Sent: Wednesday, April 13, 2011 12:16 PM To: Rachel Licata Cc: r-help@r-project.org Subject: Re: [R] Decimals in R/SQL You at least have to provide a subset of 'ss09' so we can see what the original data looks like. I have not had

Re: [R] Decimals in R/SQL

2011-04-13 Thread jim holtman
You at least have to provide a subset of 'ss09' so we can see what the original data looks like. I have not had any problems with decimals in using sqldf. > x <- as.data.frame(matrix(runif(100)*100, 10)) > x$key <- sample(1:3, 10, TRUE) > require(sqldf) > xsum <- sqldf(' + select key, sum(V1

[R] Decimals in R/SQL

2011-04-13 Thread Rachel Licata
Hello, When I am writing in sqldf or RSQLite I lose the decimals in my matrix. The only way I can get decimals is by multiplying by 1.0, etc. I have tried manipulating the options, but it is only effective once I multiply by 1.. I appreciate any suggestions! Thanks! Example: z <- s

[R] SQL & PL/SQL

2011-01-10 Thread Ramesh
Your email client cannot read this email. To view it online, please go here: http://email.careermailer.com:2020/display.php?M=161372&C=63b37a209d9dced6e8262a1862c616e4&S=552&L=5&N=559 To stop receiving these emails:http://email.careermailer.com:2020/unsubscribe.php?M=161372&C=63b37a209d9dced6e826

Re: [R] SQL/R

2010-07-26 Thread Bart Joosen
see the manual from package sqldf: http://cran.r-project.org/web/packages/sqldf/sqldf.pdf Bart -- View this message in context: http://r.789695.n4.nabble.com/SQL-R-tp2298545p2301975.html Sent from the R help mailing list archive at Nabble.com. __ R-h

Re: [R] SQL/R

2010-07-23 Thread Gildas Mazo
Thanks for your answers, Best, Gildas Brian Diggs a écrit : > On 7/22/2010 5:01 AM, Allan Engelhardt wrote: >> There are so many ways Here is one: >> >> aggregate(v ~ u, data=X, function(...) length(unique(...))) >> # u v >> # 1 T1 2 >> # 2 T2 1 >> >> Hope this helps > > Here is one othe

Re: [R] SQL/R

2010-07-22 Thread Brian Diggs
On 7/22/2010 5:01 AM, Allan Engelhardt wrote: There are so many ways Here is one: aggregate(v ~ u, data=X, function(...) length(unique(...))) # u v # 1 T1 2 # 2 T2 1 Hope this helps Here is one other way, using the plyr package (which is very good for taking a data structure (data.frame

Re: [R] SQL/R

2010-07-22 Thread Allan Engelhardt
There are so many ways Here is one: aggregate(v ~ u, data=X, function(...) length(unique(...))) #u v # 1 T1 2 # 2 T2 1 Hope this helps Allan. On 22/07/10 12:52, Gildas Mazo wrote: Dear R users, I want to aggregate data in the following way: ### X<- data.frame(u = c("T1","T1","T1",

[R] SQL/R

2010-07-22 Thread Gildas Mazo
Dear R users, I want to aggregate data in the following way: ### X <- data.frame(u = c("T1","T1","T1","T2"), v=c("a","a","b","a")) X library(sqldf) sqlOut <- sqldf("select count(distinct(v)) from X group by u") sqlOut ### Now I want to get the same result without using SQL. How can I achieve t

Re: [R] SQL-select using native R methods ?

2010-03-22 Thread Gabor Grothendieck
On Mon, Mar 22, 2010 at 6:37 AM, wrote: > Hi > I have a problem in R that I have been trying to solve but without > success. > I am trying to join two tables on two variables : an ID and a date > (optional) that will be common between the two tables > > In SQL (and SAS PROC SQL) I am a frequent u

[R] SQL-select using native R methods ?

2010-03-22 Thread Jan . Sunde
Hi I have a problem in R that I have been trying to solve but without success. I am trying to join two tables on two variables : an ID and a date (optional) that will be common between the two tables In SQL (and SAS PROC SQL) I am a frequent user of the "select" command and I am used to the fol

Re: [R] sql query variable

2010-02-18 Thread RagingJim
Thanks guys. I ended up doing as you suggested Dieter. Thanks for the idea :) -- View this message in context: http://n4.nabble.com/sql-query-variable-tp1558189p1561158.html Sent from the R help mailing list archive at Nabble.com. __ R-help@r-project.

Re: [R] sql query variable

2010-02-17 Thread Bart Joosen
Another way: cat("Station number?") flush.console() sn <- scan(quiet=TRUE,n=1) sqlQuery(conn, paste("select to_char(lsd,'-mm') as yr,ttl_mo_prcp from mo_rains where stn_num=",sn,sep="")) Bart -- View this message in context: http://n4.nabble.com/sql-query-variable-tp1558189p1558504.html S

Re: [R] sql query variable

2010-02-16 Thread Dieter Menne
RagingJim wrote: > > This is the very last thing I need to make everything work properly. My > query: > sqlQuery(conn, "select to_char(lsd,'-mm') as yr,ttl_mo_prcp from > mo_rains where stn_num=023000") > > Is there a way to may the stn_num in the query variable, ie make it so > that whenev

[R] sql query variable

2010-02-16 Thread RagingJim
This is the very last thing I need to make everything work properly. My query: sqlQuery(conn, "select to_char(lsd,'-mm') as yr,ttl_mo_prcp from mo_rains where stn_num=023000") Is there a way to may the stn_num in the query variable, ie make it so that whenever my script is run, the user must

Re: [R] SQL on R

2009-07-05 Thread JoK LoQ
Fala ai cara! Era o RMySQL mesmo q eu precisava, vlw Bernardo Rangel tura wrote: > > On Sat, 2009-07-04 at 22:24 -0700, JoK LoQ wrote: >> I'm dealing with lots of columns and conditions, wats t best way to deal >> with >> that? >> How do I work with SQL on R? the manual is quite confuse talki

Re: [R] SQL on R

2009-07-05 Thread Bernardo Rangel Tura
On Sat, 2009-07-04 at 22:24 -0700, JoK LoQ wrote: > I'm dealing with lots of columns and conditions, wats t best way to deal with > that? > How do I work with SQL on R? the manual is quite confuse talking about that. > Do I need a package? I don't understand your question, but if you think use S

[R] SQL on R

2009-07-05 Thread JoK LoQ
I'm dealing with lots of columns and conditions, wats t best way to deal with that? How do I work with SQL on R? the manual is quite confuse talking about that. Do I need a package? -- View this message in context: http://www.nabble.com/SQL-on-R-tp24340314p24340314.html Sent from the R help mail

Re: [R] SQL Queries from Multiple Servers

2009-05-15 Thread Mark Wardle
Hi. Depending on your requirements, one option would be to do the join in R using merge() If you wish to run SQL joins across multiple databases, then it is not an R problem but a database problem. For a quick solution, I would write scripts that bring all your data together into one database (co

Re: [R] SQL Queries from Multiple Servers

2009-05-14 Thread Paul Gilbert
Tom Schenk Jr wrote: I use RODBC as my conduit from R to SQL. It works well when the tables are stored on one channel, e.g., channel <- odbcConnect("data_base_01", uid="", dsn="") However, I often need to match tables across multiple databases, e.g., "data_base_01" and "data_base_02". H

  1   2   >