]> code.communitydata.science - stats_class_2019.git/blobdiff - problem_sets/week_03/ps3-worked_solution.html
typo fix for ps3 worked solution
[stats_class_2019.git] / problem_sets / week_03 / ps3-worked_solution.html
index b67d96257f444179a7fa045458aa164aa586ca8d..a909ded118ce0ebcff743e25e70233d7f6abb0a7 100644 (file)
@@ -464,7 +464,7 @@ w2.data &lt;- log1p(w2.data)</code></pre>
 <pre><code>## [1] 9.643215 2.158358 1.396595 0.192623 1.752234 0.170634</code></pre>
 <p>Inspecting the first few values returned by <code>head()</code> gave you a clue. Rounded to six decimal places, the vectors match!</p>
 <p>I can create a table comparing the sorted rounded values to check this.</p>
-<pre class="r"><code>table(sort(round(w2.data, 6)) == sort(round(w3.data$x, 6)))</code></pre>
+<pre class="r"><code>table(round(w2.data,6) == round(w3.data$x,6))</code></pre>
 <pre><code>## 
 ## TRUE 
 ##   95</code></pre>
@@ -546,7 +546,7 @@ head(w3.data)</code></pre>
 ##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max.    NA's 
 ##   -4.42    3.19    7.81    9.96   14.61   33.14       5</code></pre>
 <pre class="r"><code>### Run this line again to assign the new dataframe to p
-p &lt;- ggplot(w3.data, aes(x=x, y=y))
+p &lt;- ggplot(data=w3.data, mapping=aes(x=x, y=y))
 
 p + geom_point(aes(color=j, size=l, shape=k))</code></pre>
 <pre><code>## Warning: Using size for a discrete variable is not advised.</code></pre>

Community Data Science Collective || Want to submit a patch?