Blog Archives

Strange behavior from the cut function with dates in R

August 12, 2014
By
Strange behavior from the cut function with dates in R

I recently encountered some strange behavior from R when using the cut.POSIXt method with “day” as the interval specification. This function isn’t working as I intended and I doubt that it is working properly. I’ll show you the behavior I’m seeing (and what I was expecting) then I’ll show you my current base R workaround.

Read more »

Insert random NAs in a vector in R

July 30, 2014
By
Insert random NAs in a vector in R

I was recently writing a function which was going to need to deal with NAs in some kind of semi-intelligent way. I wanted to test it with some fake data, meaning that I was going to need a vector with some random NAs sprinkled in. After a few disappointing google searches and a stack overflow

Read more »

GIS in R: Part 1

March 27, 2014
By
GIS in R: Part 1

I messed around with R for years without really learning how to use it properly. I think it’s because I could always throw my hands up when the going got tough and run back and cling the skirts of Excel or JMP or Systat. I finally learned how to use R when I needed to

Read more »

Winter Solstice Survival Guide 2013

November 27, 2013
By
Winter Solstice Survival Guide 2013

’tis the season to consume! But for this part of the year, as the Winter Solstice approaches, we consume not for ourselves, but for others, and that’s generally a good thing. Each year we here at Science… sort of like to put together a list of suggestions for the science-inclined in your life. Whether you’re looking

Read more »

Why are Birds Dinosaurs?

June 9, 2013
By
Why are Birds Dinosaurs?

Month after month, one of the most popular posts on the Paleocave blog is the How to Read a Cladogram post I did some time ago. I always intended to follow it up with more cladistic fun. So, hold onto your butts, we’re going to let the dinosaurs loose. Birds are dinosaurs. We’ve all heard

Read more »

Writing a for-loop in R

March 23, 2013
By
Writing a for-loop in R

There may be no R topic that is more controversial than the humble for-loop. And, to top it off, good help is hard to find. I was astounded by the lack of useful posts when I googled “for loops in R” (the top return linked to a page that did not exist). In fact, even

Read more »

Science-y New Year’s Resolution: Learn to Code

December 26, 2012
By
Science-y New Year’s Resolution:  Learn to Code

In a 1995 interview Steve Jobs said he thought that computer programming should be a liberal art. In other words, he thought everyone’s education should include a year of learning a computer language, because it teaches you how to think in a certain way. If that was true in 1995, just think how much more

Read more »

moRe

December 20, 2012
By
moRe

Hopefully my first R post whetted your apatite for open source data software.  I’m gearing up for more R posts regardless.  I thought I’d do a quick post about a couple of useful commands, ‘View’ and ‘fix’. When you first break the shackles of Excel one of the toughest things is not being able to

Read more »

R you ready for this? Statistics for free!

May 7, 2011
By
R you ready for this? Statistics for free!

If you’ve listened to the show for a while or if you’ve been reading the paleocave blog from the beginning (like when we actually used to update it regularly), then you might know that I’m rather fascinated with statistics. Imagine my delight a few years ago when I found out that one of the most

Read more »