Skip to content

Commit

Permalink
trelliscope JS
Browse files Browse the repository at this point in the history
  • Loading branch information
mdancho84 committed Mar 29, 2022
1 parent c3fd9a5 commit 1d1aecd
Showing 1 changed file with 57 additions and 0 deletions.
57 changes: 57 additions & 0 deletions 050_trelliscope/050_trelliscope.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# R TIPS ----
# TIP 050 | Trelliscope JS: Interactive Data Visualization with ggplot ----
#
# 👉 For Weekly R-Tips, Sign Up Here:
# https://learn.business-science.io/r-tips-newsletter

# Documentation: https://hafen.github.io/trelliscopejs/

# INSTALLATION ----
# install.packages("trelliscopejs")


# LIBRARIES ----

library(tidyverse)
library(plotly)
library(trelliscopejs)

# DATA ----

mpg

# 1.0 GGPLOT ----
# - Add Labels: Displ Min/Max, Hwy Min/Max/Mean

mpg %>%
ggplot(aes(displ, hwy)) +
geom_point(size = 4) +
geom_smooth(se = FALSE, span = 1) +
facet_trelliscope(
~ manufacturer,
ncol = 4,
nrow = 3
)


# 2.0 MEGA BONUS: INTERACTIVE (plotly) ----

mpg %>%
ggplot(aes(displ, hwy)) +
geom_point() +
geom_smooth(se = FALSE, span = 1) +
facet_trelliscope(
~ manufacturer,
ncol = 4,
nrow = 3,
as_plotly = TRUE
)



# LEARNING MORE ----

# FREE MASTERCLASS
# - 10 SECRETS TO BECOMING A DATA SCIENTIST
# https://learn.business-science.io/free-rtrack-masterclass

0 comments on commit 1d1aecd

Please sign in to comment.