24 January, 2021

Presentation

This is a presentation file prepared using R Markdown.

Plotly example

A plot on the R built-in dataset ‘swiss’ is made using the library ‘plotly’.

The plot shows the fertility measure (‘Fertility’) against the percentage of males involved in agriculture (‘Agriculture’) in certain areas, with the color of markers representing the education level and size of markers representing the percentage of Catholics in the area.

Here is the code for the plot.

library(plotly)
plot_ly(data=swiss, y=~Fertility, x=~Agriculture, color=~Education, 
        size=~Catholic, type="scatter", mode="markers")

And here is the plot. Hover on a marker to obtain the corresponding fertility and agriculture values or brush a region to zoom in.








Thank you!