On Wed, Feb 25, 2015 at 10:28 AM, VASILEIOU Eleftheria <E.Vasileiou at ed.ac.uk> wrote: > Hi, > > I would need to use R for my analysis for my Project and my supervisor > suggested me to learn the SQL language for R. > Could you please provide me some resources for learning SQL and R?
I'm not sure if you want to learn SQL and R. Or if you want to learn just R and it's use of SQL (this assumes you know SQL already). My confusion likely is a result of my being a Texan. ;-) Some basics of the R language, in general, are here: http://cran.r-project.org/manuals.html http://adv-r.had.co.nz/ (this has move advanced R work by Hadley Wickham, an R guru/wizard) http://en.wikibooks.org/wiki/R_Programming If you need to learn SQL as well, then there are some useful sites at well. http://www.w3schools.com/sql/ is a nice one. http://www.sqlcourse.com/ I don't know this one, but it looks interesting Google search: https://www.google.com/webhp?sourceid=chrome-instant&rlz=1C1CHFX_enUS597US598&ion=1&espv=2&ie=UTF-8#q=sql%20tutorial If you tell us which SQL software you will be using, perhaps we could recommend other sites or forums where you can get SQL specific help. Now using SQL in R is a bit more difficult to explain. Mainly because there are differences depending on the SQL server you are using. I have used both RODBC and DBI. RODBC is R for ODBC connections. ODBC is an industry standard interface to a number of different SQL servers such as MS SQL Server, PostgreSQL, and MySQL (MariaDB). DBI is another interface, by the previously mentioned Hadley Wickham, which can connect to may different data base servers as well. Now, just for myself, I prefer DBI because it is a closer match to what I am used to using in other languages, such as PERL. A nice "README" by Mr. Wickham is here: https://github.com/rstats-db/DBI/blob/master/README.md http://www.stat.berkeley.edu/~nolan/stat133/Fall05/lectures/SQL-R.pdf An overview of RODBC is here: http://cran.r-project.org/web/packages/RODBC/RODBC.pdf and perhaps of some interest to you might be that the maintainer is in the U.K. Brian Ripley ripley at stats.ox.ac.uk You didn't say if you were going to be connecting to an existing SQL system, or creating your own. If you are going to create your own, then perhaps the easiest to implement is SQLite. It is not as full featured as Oracle, MS SQL Sever, or PostgreSQL, but it has the advantage of being "embedded". That is, there is very little set up because the "server" code is embedded into R itself. This means that you don't need to set up an independent server. Of course, SQLite is "lite" compared to the the "full function" data base servers previously mentioned. For SQLite, the R package is RSQLite and you can look at the "README" here: http://cran.r-project.org/web/packages/RSQLite/RSQLite.pdf One thing nice about this is that it is the work of Mr. Wickham and is generally compatible with his DBI package. This may be helpful because you could start off "easy" with RSQLite, then "upgrade" to a "real data base server" with most of the R coding remaining generally the same. And one other thing that I will warn you of about this forum. It is a "no homework" forum. This doesn't mean we won't help with general questions about approaches and the like, but people can become a bit "terse" if they feel you are trying to get someone to do your work. I just mention this because it does come up on rare occasion. > > > Thanks in advance, > Eleftheria > > Eleftheria Vasileiou BSc, MPH > Research Student, Centre for Population Health Sciences > Room 815, Old Medical School, University of Edinburgh > > E.Vasileiou at ed.ac.uk > > The University of Edinburgh is a charitable body, registered in > Scotland, with registration number SC005336. -- He's about as useful as a wax frying pan. 10 to the 12th power microphones = 1 Megaphone Maranatha! <>< John McKown

