8000 Update 2015-07-30-graphing-multiple-chart-types.Rmd · plotly/plotly.r-docs@3c76d52 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c76d52

Browse files
Update 2015-07-30-graphing-multiple-chart-types.Rmd
1 parent e45f419 commit 3c76d52

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

r/2015-07-30-graphing-multiple-chart-types.Rmd

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -58,34 +58,8 @@ fig <- fig %>% layout(xaxis = list(title = 'Displacement (cu.in.)'),
5858
fig
5959
```
6060

61-
### Loess Smoother with Uncertainty Bounds
62-
63-
```{r}
64-
library(plotly)
65-
library(broom)
66-
67-
m <- loess(mpg ~ disp, data = mtcars)
68-
69-
fig <- plot_ly(mtcars, x = ~disp, color = I("black"))
70-
fig <- fig %>% add_markers(y = ~mpg, text = rownames(mtcars), showlegend = FALSE)
71-
fig <- fig %>% add_lines(y = ~fitted(loess(mpg ~ disp)),
72-
line = list(color = 'rgba(7, 164, 181, 1)'),
73-
name = "Loess Smoother")
74-
fig <- fig %>% add_ribbons(data = augment(m),
75-
ymin = ~.fitted - 1.96 * .se.fit,
76-
ymax = ~.fitted + 1.96 * .se.fit,
77-
line = list(color = 'rgba(7, 164, 181, 0.05)'),
78-
fillcolor = 'rgba(7, 164, 181, 0.2)',
79-
name = "Standard Error")
80-
fig <- fig %>% layout(xaxis = list(title = 'Displacement (cu.in.)'),
81-
yaxis = list(title = 'Miles/(US) gallon'),
82-
legend = list(x = 0.80, y = 0.90))
83-
84-
fig
85-
```
86-
8761

8862

8963
#Reference
9064

91-
See [https://plotly.com/r/reference/](https://plotly.com/r/reference/) for more information and chart attribute options!
65+
See [https://plotly.com/r/reference/](https://plotly.com/r/reference/) for more information and chart attribute options!

0 commit comments

Comments
 (0)
0