Skip to content

Instantly share code, notes, and snippets.

View huberflores's full-sized avatar

Huber Flores (El Magico) huberflores

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)
n <- 50
m <- 50
set.seed(1)
mu <- -0.4
sig <- 0.12
x <- matrix(data=rlnorm(n*m, mu, sig), nrow=m)
library(fitdistrplus)
## Fit a log-normal distribution to the 50 random data set
f <- apply(x, 2, fitdist, "lnorm")