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