Skip to content
Browse files

Included fix suggested by Yihui Xie - Thanks~

  • Loading branch information...
1 parent da4020d commit 7b1afae4da3537a0594add11be2bd15db1298793 @cjbayesian cjbayesian committed Nov 15, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 index.Rmd
  2. +1 −1 index.html
  3. +1 −1 index.md
View
2 index.Rmd
@@ -28,7 +28,7 @@ Sponsored by:
---
```{r smallplot, fig.width=6, fig.height=6}
hw<-read.csv('data/heightweight.csv')
-fit<-lm(hw$weightLb~hw$heightIn)
+fit<-lm(weightLb~heightIn,data=hw)
plot(hw$heightIn,hw$weightLb,xlab='Height (Inches)',ylab='Weight (Lbs)')
@yihui
yihui added a note Nov 16, 2012

great, the same treatment can be applied to plot() as well: plot(weightLb ~ heightIn, data = hw, ...

@cjbayesian
MontrealRUserGroup member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
abline(fit,lty=2)
```
View
2 index.html
@@ -76,7 +76,7 @@
</hgroup>
<article>
<pre><code class="r">hw &lt;- read.csv(&quot;data/heightweight.csv&quot;)
-fit &lt;- lm(hw$weightLb ~ hw$heightIn)
+fit &lt;- lm(weightLb ~ heightIn, data = hw)
plot(hw$heightIn, hw$weightLb, xlab = &quot;Height (Inches)&quot;, ylab = &quot;Weight (Lbs)&quot;)
abline(fit, lty = 2)
</code></pre>
View
2 index.md
@@ -29,7 +29,7 @@ Sponsored by:
```r
hw <- read.csv("data/heightweight.csv")
-fit <- lm(hw$weightLb ~ hw$heightIn)
+fit <- lm(weightLb ~ heightIn, data = hw)
plot(hw$heightIn, hw$weightLb, xlab = "Height (Inches)", ylab = "Weight (Lbs)")
abline(fit, lty = 2)
```

0 comments on commit 7b1afae

Please sign in to comment.
Something went wrong with that request. Please try again.