Need a hint?

So, your analysis in R has been in progress for hours (or days) and one of two problems has arisen:

One, you created an object called “analysis.113” and cannot, for the life of you, remember what it is or how you made it.

OR

Two, you have your object and know what you want to do with it but cannot remember the name of the  auxiliary function you need (as in, what’s the function for finding Cook’s distance on a glm object again?).

Sanford Weisberg and Hadley Wickham have created the “hints” package to help in these very situations.

hints() can be applied to any object and it will identify what kind of object it is, list the generic functions associated with the object class and search your available documentation for all mentions of the class.

This package should definitely come in handy.

Advertisements

3 responses to “Need a hint?

  1. Even better, of course – use more memorable names for objects ;-) …

  2. Good point!

    However, imagine a situation where you’re teaching and a student gets lost in the R and asks for your help manipulating what they believe is a simple regression object that is not behaving as expected. Rather than going through their history, or their nonexistent scripts, hint() could instantly tell you what they’ve created.

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