Skip to content

Instantly share code, notes, and snippets.

@myuen
Created September 13, 2013 03:45
Show Gist options
  • Save myuen/6546602 to your computer and use it in GitHub Desktop.
Save myuen/6546602 to your computer and use it in GitHub Desktop.
a <- 2
b <- -3
sigSq <- 0.5
x <- runif(40)
y <- a + b * x + rnorm(40, sd = sqrt(sigSq))
(avgX <- mean(x))
write(avgX, file="avgX.txt")
plot(x, y)
abline(a, b, col = "purple")
dev.print(pdf, "toylinePlot.pdf")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment