typo fix for ps3 worked solution
This commit is contained in:
@@ -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
|
### list.files("data/week_03") # just take a look around
|
||||||
### w3.data <- read.csv("data/week_03/group_01.csv")
|
### 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!
|
### 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.
|
I can create a table comparing the sorted rounded values to check this.
|
||||||
```{r}
|
```{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?
|
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)
|
lapply(w3.data, summary)
|
||||||
|
|
||||||
### Run this line again to assign the new dataframe to p
|
### 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))
|
p + geom_point(aes(color=j, size=l, shape=k))
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -464,7 +464,7 @@ w2.data <- log1p(w2.data)</code></pre>
|
|||||||
<pre><code>## [1] 9.643215 2.158358 1.396595 0.192623 1.752234 0.170634</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>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>
|
<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>##
|
<pre><code>##
|
||||||
## TRUE
|
## TRUE
|
||||||
## 95</code></pre>
|
## 95</code></pre>
|
||||||
@@ -546,7 +546,7 @@ head(w3.data)</code></pre>
|
|||||||
## Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
|
## 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>
|
## -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
|
<pre class="r"><code>### 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))</code></pre>
|
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>
|
<pre><code>## Warning: Using size for a discrete variable is not advised.</code></pre>
|
||||||
|
|||||||
Reference in New Issue
Block a user