When coding, be foxy!

For this post, I’d like to go back a bit and relate to chapter 2 from The Signal and the Noise where Silver talked about foxes versus hedgehogs idea of forecasters’ personality. Foxes like to pick-up ideas from anywhere and everywhere to help in developing and critically reflect on their thought, while hedgehogs often get stuck on one idea and inflexible.  I think being foxes can go a long way for coders, and in a way, it’s also just really hard to be a hedgehog in R.

R isn’t my first coding language (it was C++), yet I’m not sure if things have gotten easier as I begin to code more and more in depth.  Perhaps not surprisingly, I still run into the same problems I had while using C++, most often just on where to start, as I think many will agree.  My place of starting have often been in the Google search box, which has turned out to be the most wonderful resource.  R has an amazing online community that, thanks goodness, loves to share. Through my (really short) time of coding, I have come to see and really appreciate how different everyone think.  I hardly see anyone approach the same problem with the same way that I’ve approached it, and most of the time it would be completely different.  Perhaps it’s because we are all starting out and aren’t sure of which is the best way, as we know that there are many ways to arrive at the same answer in R, with answers ranging between 1 to infinite lines of code.  However, it is not seeing the answer, but the different ways of getting to the answers, that have been most valuable to me for learning to code effectively.  There have been moments where I thought, “Why didn’t I think of that?”, and others “Why did this person put themselves through so much pain?”  I was, unconsciously, thinking like a fox with R, looking for ideas everywhere, and more often than not, I would find new functions to learn about and use, gladly fixing my code to a neater version.

It is not to say that you shouldn’t think on your own at all, like a hedgehog, as creating your own ideas is very important, who knows, you might be the one to figure out how to most effectively solve the problem (or create the next R package).  But being a fox and consulting with fellow coders can give you useful insights that you might not have think of before.  For me at least, I am usually unsure that my answer is correct and would seek to compare my work and someone else to see if my thought process was logical.  After all, it is likely that someone before you have already pondered through the problem you are working on, so why not use that to your advantage to refine your work? What is science but a collaboration between past and current work to learn more about a problem?

With that note, I’d like to share some links through my Google ventures that might be of help to your future work:

http://www.r-tutor.com/ – great site for example of using some basic R stats function

http://zevross.com/blog/2014/08/04/beautiful-plotting-in-r-a-ggplot2-cheatsheet-3/ – a pretty comprehensive cheat sheet on how to make your ggplot look the way you want

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s