#random 100 points from exponential 
n=100
x=rexp(n,rate=1/2)
library(tidyverse)
## Loading tidyverse: ggplot2
## Loading tidyverse: tibble
## Loading tidyverse: tidyr
## Loading tidyverse: readr
## Loading tidyverse: purrr
## Loading tidyverse: dplyr
## Conflicts with tidy packages ----------------------------------------------
## filter(): dplyr, stats
## lag():    dplyr, stats
library(plotly)
## 
## 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
data=as.data.frame(x)
plot_ly(data,type="scatter",x=~x)
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
#3D plots 
x=c(100:200)
y=c(100:200)
z=c(100:200)

data1=rbind.data.frame(x,y,z)

plot_ly(data1, x = ~x, y = ~y, z = ~z) 
## No trace type specified:
##   Based on info supplied, a 'scatter3d' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter3d
## No scatter3d mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode
#Simpulate independent expenential
e1=rexp(100,rate=1/2)
e2=rexp(100,rate = 2)
par(mfrow=c(2,2))
hist(e1)
hist(e2)
data2=cbind.data.frame(e1,e2)
plot_ly(data2,x=~e1,y=~e2)
## No trace type specified:
##   Based on info supplied, a 'scatter' trace seems appropriate.
##   Read more about this trace type -> https://plot.ly/r/reference/#scatter
## No scatter mode specifed:
##   Setting the mode to markers
##   Read more about this attribute -> https://plot.ly/r/reference/#scatter-mode