Articles by Stephen Turner

New Year’s Resolution: Learn How to Code

January 5, 2012 | Stephen Turner

Farhad Manjoo at Slate has a good article on why you need to learn how to program. Chances are, if you're reading this post here you're already fairly adept at some form of programming. But if you're not, you should give it some serious thought.Gina Trapani, former editor of ... [Read more...]

Query a MySQL Database from R using RMySQL

December 15, 2011 | Stephen Turner

I use this all the time, and the setup is dead simple. Follow the code below to load the RMySQL package, connect to a database (here the UCSC genome browser's public MySQL instance), set up a function to make querying easier, and query the database to ... [Read more...]

Scatterplot matrices in R

July 25, 2011 | Stephen Turner

I just discovered a handy function in R to produce a scatterplot matrix of selected variables in a dataset. The base graphics function is pairs(). Producing these plots can be helpful in exploring your data, especially using the second method below.Try...
[Read more...]

Steal This Blog!

June 22, 2011 | Stephen Turner

I wanted to contribute any content and code I post here to the R Programming Wikibook so I made a slight change to the Creative Commons license on this blog. All the written content is now cc-by-sa and all the code here is still open source BSD. So fee...
[Read more...]

More Command-Line Text Munging Utilities

May 19, 2011 | Stephen Turner

In a previous post I linked to gcol as a quick and intuitive alternative to awk. I just stumbled across yet another set of handy text file manipulation utilities from the creators of the BEAGLE software for GWAS data imputation and analysis. In additio...
[Read more...]

Accessing Databases From R

May 9, 2011 | Stephen Turner

Jeffrey Breen put together a useful slideshow on accessing databases from R. I use RODBC every single day to access my own local MySQL server from R. I've had trouble with RMySQL, so I've always used RODBC instead after setting up my localhost MySQL se... [Read more...]

Using LaTeX for Math Formulas on the Web

April 20, 2011 | Stephen Turner

I love the idea of using R+LaTeX+Sweave for reproducible research. This is even easier now that R has a jazzy new IDE that supports Sweave syntax highlighting and automatic PDF generation. I know I'm going to take some flak for saying this, but let's ... [Read more...]

Prune GWAS data in R

March 29, 2011 | Stephen Turner

Hansong Wang, our biostats professor here at the Hawaii Cancer Center, generously gave me some R code that goes through a SNP annotation file (i.e. a mapfile) and selects SNPs that are at least a certain specified distance apart. You might want to do t...
[Read more...]

RStudio Keyboard Shortcut Reference PDF

March 21, 2011 | Stephen Turner

I recently started using RStudio, the amazing new IDE for R. You can view all of RStudio's keyboard shortcuts by going to the help menu, but I made this printable reference for myself and thought I'd share it. I only included the Windows shortcuts, and... [Read more...]
1 3 4 5 6 7 9

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)