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
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
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
...@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
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
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
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
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
; 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
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
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
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
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
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
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
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
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
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 ; '
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
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
> 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
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
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
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
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
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
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
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.
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
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
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
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
-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
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
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
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
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
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
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
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
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
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
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
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
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
?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
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
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
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
_
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
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
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
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/
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
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
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
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
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
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:
?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
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("
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
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
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-
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
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
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
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'")
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
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 =
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
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
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
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
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
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
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
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
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
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-
>
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
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
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
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
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
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
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
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",
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
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
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
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.
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
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
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
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
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
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
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
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 - 100 of 124 matches
Mail list logo