• Stars
    star
    326
  • Rank 118,382 (Top 3 %)
  • Language
    R
  • License
    Other
  • Created over 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Creates Page Layout Visualizations in R πŸ“„πŸ“„πŸ“„

ggpage

Travis build status AppVeyor build status Coverage status CRAN status

ggpage is a package to create pagestyled visualizations of text based data. It uses ggplot2 and final returns are ggplot2 objects.

Version 0.2.0

In this new version I have worked to include a lot of use cases that wasn’t available in the first version. These new elements are previewed in the vignette.

Installation

You can install the released version of ggpage from CRAN with:

install.packages("ggpage")

or you can install the developmental version of ggpage from github with:

# install.packages("devtools")
devtools::install_github("EmilHvitfeldt/ggpage")

Example

The package includes The Tinder-box by H.C. Andersen for examples.

library(tidyverse)
#> Warning: replacing previous import 'dplyr::vars' by 'rlang::vars' when
#> loading 'dbplyr'
library(ggpage)

head(tinderbox, 10)
#> # A tibble: 10 x 2
#>    text                                                        book        
#>    <chr>                                                       <chr>       
#>  1 "A soldier came marching along the high road: \"Left, righ… The tinder-…
#>  2 had his knapsack on his back, and a sword at his side; he … The tinder-…
#>  3 and was now returning home. As he walked on, he met a very… The tinder-…
#>  4 witch in the road. Her under-lip hung quite down on her br… The tinder-…
#>  5 "and said, \"Good evening, soldier; you have a very fine s… The tinder-…
#>  6 knapsack, and you are a real soldier; so you shall have as… The tinder-…
#>  7 "you like.\""                                               The tinder-…
#>  8 "\"Thank you, old witch,\" said the soldier."               The tinder-…
#>  9 "\"Do you see that large tree,\" said the witch, pointing … The tinder-…
#> 10 "beside them. \"Well, it is quite hollow inside, and you m… The tinder-…

The basic workflow with ggpage is using either

  • ggpage_quick for a quick one function call plot or,
  • combining ggpage_build and ggpage_plot to do analysis (NLP for example) before the final plot is produced.

For a simple demonstration we apply ggpage_quick to our tinderbox object. It is important that the data.frame that is used have the text in a column named β€œtext”.

ggpage_quick(tinderbox)
#> Warning: replacing previous import 'dplyr::vars' by 'rlang::vars' when
#> loading 'tidytext'

# Also pipeable
# tinderbox %>% ggpage_quick()

The same result would be achieved by using

tinderbox %>% 
  ggpage_build() %>% 
  ggpage_plot()

But this approach allows us to introduce more code between ggpage_build and ggpage_plot giving us multiple more ways to enhance the plots

tinderbox %>%
  ggpage_build() %>%
  mutate(long_word = stringr::str_length(word) > 8) %>%
  ggpage_plot(aes(fill = long_word)) +
  labs(title = "Longer words throughout The Tinder-box") +
  scale_fill_manual(values = c("grey70", "blue"),
                    labels = c("8 or less", "9 or more"),
                    name = "Word length")

More Repositories

1

r-color-palettes

Comprehensive list of color palettes available in R β€οΈπŸ§‘πŸ’›πŸ’šπŸ’™πŸ’œ
R
1,264
star
2

paletteer

🎨🎨🎨 Collection of most color palettes in a single R package
R
779
star
3

smltar

Manuscript of the book "Supervised Machine Learning for Text Analysis in R" by Emil Hvitfeldt and Julia Silge
TeX
227
star
4

RStudioConf2020Slides

Links to slides for rstudio::conf 2020
179
star
5

ISLR-tidymodels-labs

R
149
star
6

R-text-data

List of textual data sources to be used for text mining in R
139
star
7

prismatic

color manipulation R package Simply and Tidy
R
127
star
8

textdata

Download, parse, store, and load text datasets instead of storing it in packages
R
69
star
9

useR2020-text-modeling-tutorial

CSS
56
star
10

friends

The Entire Transcript from Friends in Tidy Format
R
50
star
11

quarto-roughnotation

An extension that uses the roughnotation javascript library to add animated annotations to revealjs documents.
JavaScript
43
star
12

gganonymize

Anonymize the labels and text in a ggplot2
R
42
star
13

quarto-nes-theme

A Quarto reveal.js theme based on NES.css
SCSS
33
star
14

quarto-revealjs-letterbox

A Quarto reveal.js theme based on xaringan letterbox
HTML
30
star
15

quickpalette

πŸƒβ€β™€οΈπŸŽ¨ R package for quick extraction of color palettes from text and images
R
25
star
16

ggshapes

Adding various geometrical shapes to ggplot2
R
25
star
17

emoji

Data About Emojis
R
24
star
18

bookdown-github-actions-netlify

Example of using Github Actions to deploy bookdown on Netlify
R
21
star
19

unitscales

Adding additional ggplot2 scales that adds units
R
20
star
20

quarto-iframe-examples

JavaScript
18
star
21

quarto-designmode

Quarto Extension to enable DesignMode
JavaScript
18
star
22

walmartAPI

Walmart Open API Wrapper
R
17
star
23

xaringancolor

Uniform Colors in Xaringan Presentations
R
17
star
24

xaringan-gallery

xaringan gallery, a growing collection of examples and custom themes
HTML
17
star
25

talk-nyr-slidecraft

HTML
15
star
26

horus

Visual tools to help machine learning model selection
R
14
star
27

scotus

Collection of Supreme Court of the United States' Opinions.
R
12
star
28

elevators

Data Package Containing Information About Elevators in NYC
R
12
star
29

quarto-snow

Quarto Extension to add snow
JavaScript
10
star
30

emilhvitfeldt

10
star
31

hcandersenr

An R Package for H.C. Andersens fairy tales
R
9
star
32

wordsalad

Provide Tools to Extract and Analyze Word Vectors
R
8
star
33

ferriswheels

Harmless data set about ferris wheels
R
8
star
34

quarto-revealjs-seasons

quarto revealjs seasons theme template
SCSS
8
star
35

quarto-revealjs-earth

Watercolor earth Quarto reveal.js theme
SCSS
8
star
36

quarto-revealjs-cinco-de-mayo

Cinco de Mayo Quarto reveal.js theme
JavaScript
8
star
37

quarto-revealjs-inverse

quarto revealjs inverse theme template
SCSS
7
star
38

tidygutenbergr

cleaned gutenbergr text
R
7
star
39

tilemapr

R functions for square and hextile maps
R
7
star
40

workshop-useR2022-tidymodels

R
7
star
41

palette2vec

Technique to Embed Color Palettes to Multidimensional Space
R
6
star
42

fontscales

Use Iconographic Fonts in 'ggplot2'
R
6
star
43

offensiveR

R package that checks for offensive words in texts and documents
R
5
star
44

talk-rstudioconf2022-tidyclust

JavaScript
5
star
45

talk-useR2022-textrecipes

HTML
5
star
46

genderify

HTML
5
star
47

pptxtemplates

Provide themed powerpoint presentation templates to rmarkdown
R
5
star
48

index-challenge

R
5
star
49

rstats-adventofcode

R
5
star
50

emiladdins

Moar Addins for RStudio
R
5
star
51

talk-purrr-ocrug-2023

HTML
4
star
52

quarto-revealjs-highlightword

quarto Revealjs pluging for styled codechunks
JavaScript
4
star
53

aocfuns

Advent Of Code helper functions
R
4
star
54

extrasteps

More Steps for the 'recipes' Package
R
4
star
55

ggrandom

Introduce Absolute Chaos to 'ggplot2'
R
4
star
56

dplyr-slides

JavaScript
4
star
57

working-with-docker

🐳 Worked minimal examples of workflows with Docker and R
Dockerfile
4
star
58

percentify

Splitting a dataset according to percentile ranges to be used with tidy verbs
R
4
star
59

github-issue-table

HTML
3
star
60

fastTextR

An Interface to the 'fastText' Library
C++
3
star
61

quarto-syntax-theme-editor

Low-tech quarto syntax highlighting theme editor
R
3
star
62

tidytuesday

#TidyTuesday Gallery
3
star
63

quarto-revealjs-codewindow

quarto Revealjs pluging for styled codechunks
CSS
3
star
64

miscpalettes

R package with miscellaneous color palettes
R
3
star
65

textmodels4pharma

SCSS
3
star
66

AU-2021spring-627

HTML
3
star
67

refactoring-r

Refactoring in R
R
3
star
68

workshop-ocrug-hackathon-nlp

HTML
3
star
69

AU-2021fall-627

HTML
3
star
70

emilverse

Easily Install and Load Select Packages
R
2
star
71

Tree-GenViz

R
2
star
72

quarto-revealjs-merry

JavaScript
2
star
73

color-resources

A curated list of resources related to the use of colors
2
star
74

workshops

2
star
75

talks

My collection of talks
HTML
2
star
76

rstudioconf-agenda

HTML
2
star
77

emilfun

Personal R Package
R
2
star
78

recap

R
2
star
79

ggshuffle

Tool to determine if the plotting order impacts the resulting ggplot2
R
2
star
80

quarto-revealjs-template

Personal Quarto Revealjs Template
SCSS
2
star
81

talk-AstraZeneca-recipes

HTML
2
star
82

courses

2
star
83

ggtetris

Create Tetris Chart Visualizations in R
R
1
star
84

animals

Dataset with Descriptions of Animals
R
1
star
85

AU-2021spring-615

HTML
1
star
86

Polygon-splitting-genViz

R
1
star
87

githublink

What the Package Does (One Line, Title Case)
R
1
star
88

tripleblind

R
1
star
89

palmtrees

Data About All Species of Palm Trees
R
1
star
90

callcheckreprex

What the Package Does (One Line, Title Case)
R
1
star
91

foo

1
star
92

virtual-art-gallery-backup

HTML
1
star
93

talk-positconf2023-101-slides

HTML
1
star
94

custom-font

emilhvitfeldt.github.io/custom-font
JavaScript
1
star
95

hex-stickers

My personal hex sticker
R
1
star
96

paletteerbot

R
1
star
97

sherlock

Sherlock Holmes text as Data
R
1
star
98

workshop-nhs-tidymodels

JavaScript
1
star