##
## 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
## No trace type specified:
## Based on info supplied, a 'scatter' trace seems appropriate.
## Read more about this trace type -> https://plotly.com/r/reference/#scatter
## Warning: `line.width` does not currently support multiple values.
## Warning: `line.width` does not currently support multiple values.
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
## Warning in RColorBrewer::brewer.pal(N, "Set2"): minimal value for n is 3, returning requested palette with 3 different levels
library(plotly)
d <- diamonds[sample(nrow(diamonds), 1000), ]
p <-ggplot(data = d, aes(x = carat, y = price)) +geom_point(aes(text =paste("Clarity:", clarity)), size =4) +geom_smooth(aes(colour = cut, fill = cut)) +facet_wrap(~ cut)
## Warning: Ignoring unknown aesthetics: text
p=ggplotly(p)
## `geom_smooth()` using method = 'loess' and formula 'y ~ x'
p
library(plotly)
p<-plot_ly(midwest,x=~percollege,y=~state,color=~state,type="box")
p
library(plotly)
var1=seq(1,8)
var2=c(0,1,4,1,8,7,5,4)
var3=c(7,8,4,2,1,2,0,1)
p <-plot_ly(x = var1, y = var2,
type="scatter", mode="markers",
fill ="tozeroy")
p
#install.packages("webshot")library(networkD3)
## Warning: package 'networkD3' was built under R version 4.2.2
library(webshot)
## Warning: package 'webshot' was built under R version 4.2.2