Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Zack-M's full-sized avatar

Zack M (Sachin) Zack-M

  • Data Science Consultant
View GitHub Profile
@Zack-M
Zack-M / dput example.R
Created December 28, 2016 14:37 — forked from dsparks/dput example.R
Illustrating the use of dput()
# Let's say you have an R object that you'd like to share with someone else
# but, for whatever reason, it is necessary to share it in text form.
# Generate a random data.frame
set.seed(1337)
NN <- 10
theData <- data.frame(Alpha = rnorm(NN),
Beta = rnorm(NN))
theData$Gamma <- theData$Alpha * 2 + theData$Beta / 2 + rnorm(NN)
print(theData)