TizVic
August 6, 2017
This presentation concerns the use of plot_ly within a R Markdown document (R Markdown presentation with Slidy). It presents a study of Orange dataset:
Tree. An ordered factor indicating the tree on which the measurement is made.
age. A numeric vector giving the age of the tree (days since 1968/12/31)
circumference. A numeric vector of trunk circumferences (mm).
library(plotly)
library(datasets)
p <- Orange %>%
plot_ly(x = ~age, y = ~circumference, type = "scatter",
mode = "lines,markers", color = ~Tree) %>%
layout(title = 'Orange Trees size vs Age',
xaxis=list(title = 'Age (Days since 1968-12-31)'),
yaxis=list(title = 'Circumference (mm)'))
p