Skip to content

Commit 246f582

Browse files
committed
2 parents d143bb3 + f6b9916 commit 246f582

File tree

1 file changed

+3
-6
lines changed
  • 3-Data-Visualization/R/12-visualization-relationships

1 file changed

+3
-6
lines changed

3-Data-Visualization/R/12-visualization-relationships/README.md

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ With this color scheme change, you can see that there's obviously a strong progr
7878
Another way to visualize this progression is to use size, rather than color. For colorblind users, this might be a better option. Edit your visualization to show an increase of price by an increase in dot circumference:
7979

8080
```r
81-
library(ggplot2)
8281
ggplot(honey, aes(x = priceperlb, y = state)) +
8382
geom_point(aes(size = year),colour = "blue") +
8483
scale_size_continuous(range = c(0.25, 3))
@@ -95,19 +94,17 @@ To discover a correlation between some of the variables in this dataset, let's e
9594

9695
Question: Is there a clear rise in price of honey per pound year over year? You can most easily discover that by creating a single line chart:
9796

98-
```python
99-
sns.relplot(x="year", y="priceperlb", kind="line", data=honey);
97+
```r
98+
qplot(honey$year,honey$priceperlb, geom='smooth', span =0.5, xlab = "year",ylab = "priceperlb")
10099
```
101100
Answer: Yes, with some exceptions around the year 2003:
102101

103102
![line chart 1](images/line1.png)
104103

105-
✅ Because Seaborn is aggregating data around one line, it displays "the multiple measurements at each x value by plotting the mean and the 95% confidence interval around the mean". [Source](https://seaborn.pydata.org/tutorial/relational.html). This time-consuming behavior can be disabled by adding `ci=None`.
106-
107104
Question: Well, in 2003 can we also see a spike in the honey supply? What if you look at total production year over year?
108105

109106
```python
110-
sns.relplot(x="year", y="totalprod", kind="line", data=honey);
107+
qplot(honey$year,honey$totalprod, geom='smooth', span =0.5, xlab = "year",ylab = "totalprod")
111108
```
112109

113110
![line chart 2](images/line2.png)

0 commit comments

Comments
 (0)