Introduction to the plotly Package in R (Example) | Draw Interactive Plots | Create Web-Based Graphs
Автор: Statistics Globe
Загружено: 1 дек. 2021 г.
Просмотров: 6 224 просмотра
How to use the plotly package as an alternative graphing library to ggplot2 using JavaScript to render the final graphics in the R programming language. More details: https://statisticsglobe.com/plotly-r-...
R code of this video:
df <- mtcars
df$name <- row.names(mtcars)
install.packages("plotly")
library(plotly)
plot_ly(
data = df,
x = ~cyl,
y = ~disp
)
plot_ly(
data = df,
x = ~cyl,
y = ~disp,
type = "scatter",
mode = "markers"
)
plot_ly(
data = df,
x = ~cyl,
y = ~disp,
color = ~factor(cyl),
type = "scatter",
mode = "markers"
)
plot_ly(
data = df,
x = ~cyl,
y = ~disp,
color = ~factor(cyl),
text = ~name,
type = "scatter",
mode = "markers"
)
fig <- ggplot2::ggplot(data = df, aes(x=cyl, y=disp)) + geom_point(aes(color = factor(cyl)))
ggplotly(fig)
Follow me on Social Media:
Facebook – Statistics Globe Page: / statisticsglobecom
Facebook – Group for Discussions & Questions: / statisticsglobe
LinkedIn – Statistics Globe Page: / statisticsglobe
LinkedIn – Group for Discussions & Questions: / 12555223
Twitter: / joachimschork

Доступные форматы для скачивания:
Скачать видео mp4
-
Информация по загрузке: