R‎ > ‎

Custom R Functions

These are functions that I've written to perform basic tasks in R that are often encountered in my research as a sociologist.
SelectionFile type iconFile nameDescriptionSizeRevisionTimeUser
ċ

Download
This function, written by Andrew Gelman, in the arm package does an attach() that overwrites the current variable that is being attached instead of copying into R's liminal state. Very useful when working with big datasets with lots of variables.  1k v. 2 Jan 26, 2010, 6:44 AM David Eagle
ċ

Download
This is a function that searches through the variable names in a dataframe and returns the matches. Does not search labels, but could easily be extended to do that, too.  1k v. 1 Aug 17, 2010, 11:10 AM David Eagle
ċ

Download
Written by Paul Johnson, this extremely useful function creates "tight" regression tables (a la outreg in STATA) in R. This version prints p values at p<.01,p<.05,p<.001. I will also fix the way it prints column headings, but that will be in the next version!  6k v. 4 Jan 20, 2010, 8:05 AM David Eagle
ċ

Download
Prints significance stars for various p-values. Useful when wanting to output stars to a regression table to print in Latex or Excel.  1k v. 1 Jan 3, 2010, 9:57 PM David Eagle
ċ

Download
These are functions that return R-squared for lm models and pseudo R-squared for glm models.  1k v. 1 Feb 1, 2010, 1:48 PM David Eagle
Comments