Skip to content

Commit

Permalink
readying for 0.2.0 release to CRAN
Browse files Browse the repository at this point in the history
  • Loading branch information
clauswilke committed Jul 24, 2017
1 parent eab8643 commit 8921f59
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 26 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: ggjoy
Type: Package
Title: Joyplots in 'ggplot2'
Version: 0.1.0.9990
Version: 0.2.0
Authors@R: c(
person("Claus O.", "Wilke", , "[email protected]", c("cre", "aut")),
person("RStudio", role = c("cph")))
Expand Down
12 changes: 5 additions & 7 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
This is the second try to submit a new package ggjoy, which provides new geoms for ggplot2.
This is a minor version increase for ggjoy, providing numerous improvements and new features.

I received two requests for changes in response to the first try:

> Please single quote ggplot2.
Done.
I received the following request at a previous submission:

> Can you provide a reference for joyplot in the form
> Authors (year) <DOI:.....> (with no space after 'DOI:')?
No, no such reference exists at this time. I only have the code on github.
Answer: No, no such reference exists at this time. I only have the code on github.

## Test environments
* R devel and R 3.4.1 on win-builder [ via devtools::build_win() ]
Expand All @@ -23,5 +21,5 @@ Possibly mis-spelled words in DESCRIPTION:
The spelling is correct.

## Downstream dependencies
None, this is a first-time submission.
None at this time.

5 changes: 3 additions & 2 deletions inst/doc/gallery.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ library(forcats)
Catalan_elections %>%
mutate(Alt = (as.numeric(as.factor(Year))-1) %% 2 + 1) %>%
ggplot(aes(y = as.factor(Year) %>% fct_rev())) +
geom_joy(aes(x = Percent, fill = paste(Option, Alt)), alpha = .8, color = "white") +
geom_joy(aes(x = Percent, fill = paste(Option, Alt)),
alpha = .8, color = "white", from = 0, to = 100) +
labs(x = "Vote (%)",
y = "Election Year",
title = "Indy vs Unionist vote in Catalan elections",
subtitle = "Analysis unit: municipalities (n = 949)",
caption = "Marc Belzunces (@marcbeldata) | Source: Idescat") +
scale_y_discrete(expand = c(0.01, 0)) +
scale_x_continuous(limits = c(0, 100), expand = c(0.01, 0)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_fill_manual(breaks = c("Indy 1", "Unionist 1"),
labels = c(`Indy 1` = "Indy", `Unionist 1` = "Unionist"),
values = c("#ff0000", "#ff8080", "#0000ff", "#8080ff"),
Expand Down
5 changes: 3 additions & 2 deletions inst/doc/gallery.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ library(forcats)
Catalan_elections %>%
mutate(Alt = (as.numeric(as.factor(Year))-1) %% 2 + 1) %>%
ggplot(aes(y = as.factor(Year) %>% fct_rev())) +
geom_joy(aes(x = Percent, fill = paste(Option, Alt)), alpha = .8, color = "white") +
geom_joy(aes(x = Percent, fill = paste(Option, Alt)),
alpha = .8, color = "white", from = 0, to = 100) +
labs(x = "Vote (%)",
y = "Election Year",
title = "Indy vs Unionist vote in Catalan elections",
subtitle = "Analysis unit: municipalities (n = 949)",
caption = "Marc Belzunces (@marcbeldata) | Source: Idescat") +
scale_y_discrete(expand = c(0.01, 0)) +
scale_x_continuous(limits = c(0, 100), expand = c(0.01, 0)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_fill_manual(breaks = c("Indy 1", "Unionist 1"),
labels = c(`Indy 1` = "Indy", `Unionist 1` = "Unionist"),
values = c("#ff0000", "#ff8080", "#0000ff", "#8080ff"),
Expand Down
11 changes: 6 additions & 5 deletions inst/doc/gallery.html

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions inst/doc/introduction.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,13 @@ ggplot(iris, aes(x = Sepal.Length, y = Species)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_y_discrete(expand = c(0.01, 0))

## ----message=FALSE-------------------------------------------------------
ggplot(iris, aes(x = Sepal.Length, y = Species)) +
geom_joy() +
theme_minimal(base_size = 14) + theme(axis.text.y = element_text(vjust = 0)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_y_discrete(expand = c(0.01, 0))

## ----message=FALSE-------------------------------------------------------
ggplot(iris, aes(x = Sepal.Length, y = Species, height = ..density..)) +
geom_joy(stat = "density")
Expand Down
14 changes: 12 additions & 2 deletions inst/doc/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,9 @@ ggplot(iris, aes(x = Sepal.Length, y = Species)) +
```


## Theme
## Themes

Joyplots tend to require some theme modifications to look good. Most importantly, the y-axis labels should be vertically aligned so that they are flush with the axis ticks rather than vertically centered. The ggjoy package provides a theme `theme_joy` that does this and a few other theme modifications.
Joyplots tend to require some theme modifications to look good. Most importantly, the y-axis tick labels should be vertically aligned so that they are flush with the axis ticks rather than vertically centered. The ggjoy package provides a theme `theme_joy` that does this and a few other theme modifications.

```{r message=FALSE}
ggplot(iris, aes(x = Sepal.Length, y = Species)) + geom_joy() + theme_joy()
Expand All @@ -128,6 +128,16 @@ ggplot(iris, aes(x = Sepal.Length, y = Species)) +
scale_y_discrete(expand = c(0.01, 0))
```

If you prefer to use a different theme than `theme_joy`, for example `theme_minimal`, it is still advisable to adjust the alignment of the axis tick labels and the axis scales.
```{r message=FALSE}
ggplot(iris, aes(x = Sepal.Length, y = Species)) +
geom_joy() +
theme_minimal(base_size = 14) + theme(axis.text.y = element_text(vjust = 0)) +
scale_x_continuous(expand = c(0.01, 0)) +
scale_y_discrete(expand = c(0.01, 0))
```


## Stats

The default stat used with `geom_joy` is `stat_joy`. However, it may not do exactly what you want it to do, and there are other stats that can be used that may be better for your respective application.
Expand Down
20 changes: 13 additions & 7 deletions inst/doc/introduction.html

Large diffs are not rendered by default.

0 comments on commit 8921f59

Please sign in to comment.