]> code.communitydata.science - stats_class_2019.git/blobdiff - problem_sets/week_03/ps3-worked_solution.Rmd
typo fix for ps3 worked solution
[stats_class_2019.git] / problem_sets / week_03 / ps3-worked_solution.Rmd
index 0004b6ac42a5105989665c864c9c70544ee7c772..35756c3984fa72f89aea10ba12341b1c6fda20f2 100644 (file)
@@ -29,7 +29,7 @@ Now, I'll go ahead and load the CSV file into R. As with last week, I'll do this
 ### list.files("data/week_03") # just take a look around
 ### w3.data <- read.csv("data/week_03/group_01.csv")
 
-w3.data <- read.csv(url("https://communitydata.cc/~ads/teaching/2019/stats/data/week_03/group_02.csv"))
+w3.dtata <- read.csv(url("https://communitydata.cc/~ads/teaching/2019/stats/data/week_03/group_02.csv"))
 ```
 
 ### PC3. Get to know your data! 
@@ -143,7 +143,7 @@ Inspecting the first few values returned by `head()` gave you a clue. Rounded to
 I can create a table comparing the sorted rounded values to check this.
 ```{r}
 
-table(sort(round(w2.data, 6)) == sort(round(w3.data$x, 6)))
+table(round(w2.data,6) == round(w3.data$x,6))
 ```
 
 Can you explain what each piece of that last line of code is doing?
@@ -200,7 +200,7 @@ head(w3.data)
 lapply(w3.data, summary) 
 
 ### 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))
 ```

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