Last active
December 22, 2015 23:09
-
-
Save geoffwoollard/6545119 to your computer and use it in GitHub Desktop.
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
STAT 545A Homework 1 | |
======================================================== | |
My first R Markdown Document. Here's how to make one: | |
* open RStudio | |
* select File > New > R Markdown | |
* paste the R code in the skeleton. | |
* click Knit HTML to preview the page | |
* save the HTML locally and / or publish to RPubs | |
```{r} | |
n <- 50 | |
a <- 2 | |
b <- -3 | |
sigSq <- 0.5 | |
x <- runif(n) | |
y <- a + b * x + rnorm(n, sd = sqrt(sigSq)) | |
(avgX <- mean(x)) | |
``` | |
kntr takes the code in the .Rmd document and makes a .md document and figures. | |
```{r fig.width=7, fig.height=3} | |
plot(x, y) | |
abline(a, b, col = "red") | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment