Skip to content

Instantly share code, notes, and snippets.

View MansMeg's full-sized avatar

Måns Magnusson MansMeg

View GitHub Profile
@mollietaylor
mollietaylor / file.R
Created January 7, 2013 03:45
Storing a Function in a Separate File in R
# calling the functions
# this is the file where we will call the functions in fun.R and times.R
times <- dget("times.R")
times(-4:4, 2)
source("fun.R")
mult(-4:4, 2)
@stephenturner
stephenturner / progress-bar-r.r
Created February 20, 2013 20:54
Creates a text progress bar in R
niter <- 100
pb <- txtProgressBar(min=0, max=niter, style=3)
for (i in 1:niter) {
Sys.sleep(0.025) # Do something here besides sleep!
setTxtProgressBar(pb, i)
}