This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stata_summary <- | |
function( | |
x, | |
... | |
) { | |
# summarize | |
mod <- x | |
x <- summary(x) | |
# find outcome variable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#https://github.com/ateucher/useful_code/blob/master/R/numbers2words.r | |
numbers2words <- function(x){ | |
## Function by John Fox found here: | |
## http://tolstoy.newcastle.edu.au/R/help/05/04/2715.html | |
## Tweaks by AJH to add commas and "and" | |
helper <- function(x){ | |
digits <- rev(strsplit(as.character(x), "")[[1]]) | |
nDigits <- length(digits) | |
if (nDigits == 1) as.vector(ones[digits]) |