Blog Archives

A first attempt at an individual-based model in R

October 29, 2013
By
A first attempt at an individual-based model in R

I have been curious for a while as to how R might be used for the construction of an individually-based model (IBM), or agent-based model (ABM). In particular, what R objects lend themselves best to storing information on individuals, and allow for new...

Read more »

A plea for less word clouds

April 25, 2013
By
A plea for less word clouds

Word cloud of DOMA hearing transcriptsI must admit, there is something appealing about the word cloud - that is, until you try to understand what it actually means...Word clouds are pervasive - even in the science world. I was somewhat spurred to wri...

Read more »

A plea for less word clouds

April 25, 2013
By
A plea for less word clouds

Word cloud of DOMA hearing transcriptsI must admit, there is something appealing about the word cloud - that is, until you try to understand what it actually means...Word clouds are pervasive - even in the science world. I was somewhat spurred to write...

Read more »

My template for controlling publication quality figures

January 28, 2013
By
My template for controlling publication quality figures

The following is a template that I usually start with when producing figures for publication. It allows me to control:The overall size of the figure (in inches) (WIDTH, HEIGHT)The layout of figure subplots (using the layout() function) (LO)The resoluti...

Read more »

My template for controlling publication quality figures

January 28, 2013
By
My template for controlling publication quality figures

The following is a template that I usually start with when producing figures for publication. It allows me to control:The overall size of the figure (in inches) (WIDTH, HEIGHT)The layout of figure subplots (using the layout() function) (LO)The resolution of the figure (for a .png file) (RESO)I define the overall dimensions of...

Read more »

Choosing colors visually with ‘getcolors’

January 18, 2013
By
Choosing colors visually with ‘getcolors’

When plotting, I am constantly defaulting to the "main" colors in R - In other words, the colors that one can quickly call by number (1="black", 2="red", 3="green", 4="blue", ... etc.) . In my opinion, these colors do not lend themselves well to compelling graphics. I imagine this is the reason for the inclusion...

Read more »

Lomb-Scargle periodogram for unevenly sampled time series

January 10, 2013
By
Lomb-Scargle periodogram for unevenly sampled time series

In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree o...

Read more »

Lomb-Scargle periodogram for unevenly sampled time series

January 10, 2013
By
Lomb-Scargle periodogram for unevenly sampled time series

In the natural sciences, it is common to have incomplete or unevenly sampled time series for a given variable. Determining cycles in such series is not directly possible with methods such as Fast Fourier Transform (FFT) and may require some degree of interpolation to fill in gaps. An alternative is the Lomb-Scargle method (or...

Read more »

Producing animated GIFs and Videos

January 2, 2013
By
Producing animated GIFs and Videos

It took me a while to figure out how to use the animation package on my Windows OS. In making an animated GIF, the problem seems to have been quite simple in the end (and I should have been more patient in reading the instructions!) - Following installation of the program ImageMagick, one has...

Read more »

Spirograph with R

December 30, 2012
By
Spirograph with R

Just had to figure out how to replicate this old toy of mine with R! I had no idea how long it's been around:Read more »

Read more »