Skip to content
This repository has been archived by the owner on May 10, 2022. It is now read-only.

Latest commit

 

History

History
46 lines (36 loc) · 1.02 KB

coolcoolcool.md

File metadata and controls

46 lines (36 loc) · 1.02 KB

Syn

Adam Gruer 23/11/2018

devtools::install_github("ropenscilabs/syn")
library(ggplot2)
library(syn)
library(gganimate)
library(dplyr)
## 
## Attaching package: 'dplyr'

## The following objects are masked from 'package:stats':
## 
##     filter, lag

## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union

Cool, Cool, Cool, Cool!

theme_set(theme_minimal())

## basic example code
synonyms <- syn("cool") 
cool_df <- data_frame(sentence = paste0("This is really ", synonyms[1:10], "!"), x = factor("a"),  y = seq(100, 10, -10) )

ggplot(cool_df,(aes(x,y, label = sentence, group = sentence, fill = sentence))) +
  geom_label(size = 10,colour = "white",show.legend = FALSE) +
  theme_void() +
  transition_reveal(sentence, along = 100 - y) +
  enter_grow() +
  labs(title="https://github.com/ropenscilabs/syn") +
  theme(title = element_text(size = 20))