Articles by tsperry

Animated Plots with R

June 12, 2011 | tsperry

Using ImageMagick it's pretty easy to make an animated gif from a set of plots. Essentially the way to do it is to save a plot for each frame of the animation and then convert them into a .gif. Here's a simple example that plots binomial density's for ... [Read more...]

Rejection Sampling

June 9, 2011 | tsperry

An interesting sampling method that was covered briefly in my Bayesian statistics course was rejection sampling. Since I have nothing better to do, I thought it would be fun to make an acceptance-rejection algorithm using R. FUN!The Rejection Sampling method is usually used to simulate data from an unknown ... [Read more...]

Accessing MySQL through R

May 5, 2011 | tsperry

Connecting to MySQL is made very easy with the RMySQL package. To connect to a MySQL database simply install the package and load the library.install.packages("RMySQL")library(RMySQL)Connecting to MySQL:Once the RMySQL library is installed create a dat... [Read more...]

Hofstader’s Chaotic Sequence

April 30, 2011 | tsperry

About a year ago I was reading Godel, Escher, Bach by Douglas Hofstadter. In a section on recursion he presents a sequence that he calls "A Chaotic Sequence" defined as:Q(n) = Q(n - Q(n - 1)) + Q(n - Q(n - 2)) for n __ 2Q(1) = Q(2) =1It's sim... [Read more...]

Plotting Maps with R

April 26, 2011 | tsperry

I stumbled upon this tutorial while not studying and I thought it would be fun to try and plot maps of the San Francisco Bay Area household income, education, population density, poverty, etc...To do this I needed a Shapefile for the Bay Area zip codes similar to the London ... [Read more...]

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)