This is a simple presentation that combines a R markdown presentation with a Plotly chart. The chart is interactive with text markers at each data point.
August 17, 2017
This is a simple presentation that combines a R markdown presentation with a Plotly chart. The chart is interactive with text markers at each data point.
library(plotly)
data(mtcars)
plot_ly(data = mtcars,
x = mtcars$wt,
y = mtcars$disp,
mode = "markers",
type = "scatter",
color = as.factor(mtcars$cyl)
) %>%
add_trace(x = mtcars$wt,
y = ~fitted((loess(mtcars$disp ~ mtcars$wt)))) %>%
layout(title="Scatter plot + loess curve",
xaxis = list(title = "weight"),
yaxis = list(title = "displacement"))