Skip to content

Commit 78576c8

Browse files
authored
Merge pull request #62 from sibusiso16/patch-4
Update creating-overview.Rmd
2 parents 2c1f729 + c1688dc commit 78576c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

creating-overview.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ If we investigated further, we'd notice that `color` and `colors` are not offici
185185

186186
The `ggplotly()` function from the **plotly** package has the ability to translate **ggplot2** to **plotly**. This functionality can be really helpful for quickly adding interactivity to your existing **ggplot2** workflow.^[This section is not meant to teach you **ggplot2**, but rather to help point out when and why it might be preferrable to `plot_ly()`. If you're new to **ggplot2** and would like to learn it, see \@ref(ggplot2).] Moreover, even if you know `plot_ly()` and plotly.js well, `ggplotly()` can still be desirable for creating visualizations that aren't necessarily straight-forward to acheive without it. To demonstrate, let's explore the relationship between `price` and other variables from the well-known `diamonds` dataset.
187187

188-
Hexagonal binning (i.e., `geom_hex()`) is useful way to visualize a 2D density^[See Section \@ref(frequencies-2D) for approaches using `plot_ly()`], like the relationship between `price` and `carat` as shown in Figure \@ref(fig:hexbin). From Figure \@ref(fig:hexbin), we can see there is a strong positive linear relationship between the _log_ of carat and price. It also shows that many the carat is only rounded to a particular number (indicated by the light blue bands) and no diamonds are priced around $1500. Making this plot interactive makes it easier to decode the hexagonal colors into the counts that they represent.
188+
Hexagonal binning (i.e., `geom_hex()`) is useful way to visualize a 2D density^[See Section \@ref(frequencies-2D) for approaches using `plot_ly()`], like the relationship between `price` and `carat` as shown in Figure \@ref(fig:hexbin). From Figure \@ref(fig:hexbin), we can see there is a strong positive linear relationship between the _log_ of carat and price. It also shows that for many, the carat is only rounded to a particular number (indicated by the light blue bands) and no diamonds are priced around $1500. Making this plot interactive makes it easier to decode the hexagonal colors into the counts that they represent.
189189

190190
```r
191191
p <- ggplot(diamonds, aes(x = log(carat), y = log(price))) +

0 commit comments

Comments
 (0)