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.

Published by Justin Leinaweaver

I am an associate professor of political science at Drury University in Springfield, MO.

3 thoughts on “Need a hint?

  1. 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 comment