The Search Path: How R looks for stuff

Adventures with R

The good thing about sharing your knowledge with people is that you always find yourself strangely inspired. That’s what happened to me the other day in a meeting with colleagues where I were looking at some issues we were having with a reporting format we created in R Markdown. I was trying to explain to them in simple terms the little I knew about how R’s search path works and how it access objects along that path. I typed search() and got this all too familiar output

Because of the size of my console window that day, I suddenly had an analogy for them.

I asked them to imagine that they were sitting at a desk with two drawers and suddenly started looking for a particular document. What would they do?

A desk with drawers and a chair © mattbuck 2012

The first impulse would be to start from the tabletop first. This represents .GlovalEnv

View original post 70 more words

Leave a comment

Filed under Uncategorized

Your comments:

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.