Posts Tagged ‘ advanced tips ’

How to use your favorite fonts in R charts

September 20, 2012
By
How to use your favorite fonts in R charts

Today's guest post comes from Winston Chang, a software developer at RStudio — ed. When it comes to making figures in R, you can use any font you like, as long as it's Helvetica, Times, or Courier. Using other fonts that are installed on your computer can seem an impossible task, especially if you want to save the output...

Read more »

How to create random binary matrices in R

September 4, 2012
By

It all started off as a simple question from Scott Chamberlain on Twitter: Make m x n matrix with randomly assigned 0/1 -> apply(m, c(1,2), function(x) sample(c(0,1),1)) -- Better/faster solution? #rstats — Scott Chamberlain (@recology_) August 28, 2012 The goal was to create a matrix with randomly selected binary elements, and a predetermined number of rows and columns, that...

Read more »

Puzzle: A path through pairs making squares

April 23, 2012
By
Puzzle: A path through pairs making squares

Ted Harding posed an interesting puzzle challenge on the r-help mailing list recently. Here's the puzzle: Take the numbers 1, 2, 3, etc. up to 17. Can you write out all seventeen numbers in a line so that every pair of numbers that are next to each other, adds up to give a square number? You can figure out...

Read more »

Simplify working with times and dates in R

March 16, 2012
By

R has some very powerful built-in features for working with dates, times, and time-zones. But power and flexibility rarely correlate with ease-of-use, and this is no exception. The lubridate package comes to the rescue, make things a bit easier when working with chronological data in R. The paper Dates and Times Made Easy with lubridate provides in-depth explanations of...

Read more »

Optimization for Finance with R

January 9, 2012
By

Last year, the Statistics and Mathematics Department of the Vienna University School of Economics and Business presented a research seminar series on optimization, taught by R Core Group member Kurt Hornik (with Ronald Hochreiter and Stefan Theussl). Even if you couldn't make it to Austria to attend the course, the course materials are available online, and make an excellent...

Read more »

Mixed-Effects Models in R with Quantum Forest

October 26, 2011
By

For anyone who wants to estimate linear or nonlinear mixed-effects models (aka random-effects models, hierarchical models or multilevel models) using the R language, the Quantum Forest blog has several recent posts that will be of interest. Written by Luis Apiolaza from the School of Forestry at the University of Canterbury in New Zealand, the blog includes a number of...

Read more »

Using Google Spreadsheets with R: an update

September 15, 2011
By

Prompted by a rush of visitors from Andrew Gelman's blog, I went back and updated the details of my post from 2009 on reading data from Google Spreadsheets into R. Since then, Google had switched to using a secure (https) connection for Google Docs, which required some tweaks to the code. If you haven't seen it before, it's a...

Read more »

9 more ways to bring data into R

August 26, 2011
By

Here's a followup to yesterday's post on using the rdatamarket package to import data into R. Ajay Ohri at the DecisionStats blog offers nine additional methods for bringing data into R, from sources including InfoChimps, the Google Prediction API, the World Bank World Development Indicators, Bloomberg Market Data, and much more. See Ajay's post at the link below for...

Read more »

Using Emacs as a front-end for R

August 15, 2011
By

Back when I was a grad student, I was a devoted Emacs user. I basically used it like an operating system: it wasn't just my text editor, but also my mail reader, my Web browser, my news reader, and so much more. (I once even asked our sysadmin to change my default shell to /usr/bin/emacs. He refused.) So when...

Read more »

Paul Murrell on Incorporating Images in R Charts

July 13, 2011
By
Paul Murrell on Incorporating Images in R Charts

Thanks to everyone at who attended last night's Bay Area R User Group meeting, and a special thanks to our hosts Socialize (a company that makes a mobile SDK for application developers that increases user engagement) who were very generous in letting the group use their San Francisco digs for the meeting. Reflexive thanks also go to the Revolution...

Read more »