2024-09-06

Introduction

This is a simple presentation using Plotly in R.

Plotly Chart

## Loading required package: ggplot2
## 
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
## 
##     last_plot
## The following object is masked from 'package:stats':
## 
##     filter
## The following object is masked from 'package:graphics':
## 
##     layout

Use the mtcars dataset

data <- mtcars


plot <- plot_ly(data, x = ~mpg, y = ~wt, 
                type = 'scatter', mode = 'markers', 
                text = ~paste("Model:", rownames(data)))

Plot

plot