Skip to content

Commit

Permalink
rename vignette
Browse files Browse the repository at this point in the history
  • Loading branch information
daattali committed Nov 11, 2016
1 parent 315d27f commit 5bbaa1f
Show file tree
Hide file tree
Showing 28 changed files with 23 additions and 23 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
all: README.md

clean:
Rscript -e 'suppressWarnings(file.remove("README.md", "vignettes/overview.md"))'
Rscript -e 'suppressWarnings(file.remove("README.md", "vignettes/ggExtra.md"))'

.PHONY: all clean
.DELETE_ON_ERROR:
.SECONDARY:

README.md : vignettes/overview.Rmd
# echo "Rendering the overview vignette"
Rscript -e 'rmarkdown::render("vignettes/overview.Rmd", output_format = "md_document")'
README.md : vignettes/ggExtra.Rmd
# echo "Rendering the ggExtra vignette"
Rscript -e 'rmarkdown::render("vignettes/ggExtra.Rmd", output_format = "md_document")'
# echo "Correcting image paths"
# sed -i -- 's,../inst,inst,g' vignettes/overview.md
Rscript -e 'file <- gsub("\\.\\./inst", "inst", readLines("vignettes/overview.md")); writeLines(file, "vignettes/overview.md")'
Rscript -e 'file <- gsub("overview_files", "vignettes/overview_files", readLines("vignettes/overview.md")); writeLines(file, "vignettes/overview.md")'
# sed -i -- 's,../inst,inst,g' vignettes/ggExtra.md
Rscript -e 'file <- gsub("\\.\\./inst", "inst", readLines("vignettes/ggExtra.md")); writeLines(file, "vignettes/ggExtra.md")'
Rscript -e 'file <- gsub("ggExtra_files", "vignettes/ggExtra_files", readLines("vignettes/ggExtra.md")); writeLines(file, "vignettes/ggExtra.md")'
# echo "Copying output to README.md"
# cp vignettes/overview.md README.md
Rscript -e 'file.copy("vignettes/overview.md", "README.md", overwrite = TRUE)'
Rscript -e 'suppressWarnings(file.remove("vignettes/overview.md"))'
# cp vignettes/ggExtra.md README.md
Rscript -e 'file.copy("vignettes/ggExtra.md", "README.md", overwrite = TRUE)'
Rscript -e 'suppressWarnings(file.remove("vignettes/ggExtra.md"))'
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ggExtra 0.6

2016-11-04
2016-11-11

- support new ggplot2 v2.2.0 (not backwards compatible unforunately because ggplot2 internals changed too much)

Expand Down
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ distributed, and plot a simple ggplot2 scatterplot.
df1 <- data.frame(x = rnorm(500, 50, 10), y = runif(500, 0, 50))
(p1 <- ggplot(df1, aes(x, y)) + geom_point() + theme_bw())

<img src="vignettes/overview_files/figure-markdown_strict/init-plot-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/init-plot-1.png" style="display: block; margin: auto;" />

Ok, now let's add marginal density plots.

ggMarginal(p1)

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-basic-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-basic-1.png" style="display: block; margin: auto;" />

That was easy. Notice how the syntax is not following the standard
ggplot2 syntax - you don't "add" a ggMarginal layer with
Expand All @@ -104,7 +104,7 @@ Let's make the text a bit larger to make it easier to see.

ggMarginal(p1 + theme_bw(30) + ylab("Two\nlines"))

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-large-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-large-1.png" style="display: block; margin: auto;" />

Notice how the marginal plots occupy the correct space, and even when
the main plot's points are pushed to the right because of larger text or
Expand All @@ -114,7 +114,7 @@ You can also show histograms instead.

ggMarginal(p1, type = "histogram")

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-hist-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-hist-1.png" style="display: block; margin: auto;" />

There are several more parameters, here is an example with a few more
being used. Note that you can use any parameters that the `geom_XXX`
Expand All @@ -124,7 +124,7 @@ and `fill` in the following example.
ggMarginal(p1, margins = "x", size = 2, type = "histogram",
col = "blue", fill = "orange")

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-params-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-params-1.png" style="display: block; margin: auto;" />

In the above example, `size = 2` means that the main scatterplot should
occupy twice as much height/width as the margin plots (default is 5).
Expand All @@ -136,7 +136,7 @@ plots, you can use the `xparams` or `yparams` parameters, like this:

ggMarginal(p1, type = "histogram", xparams = list(binwidth = 1, fill = "orange"))

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-extraparams-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-extraparams-1.png" style="display: block; margin: auto;" />

You don't have to supply a ggplot2 scatterplot, you can also just tell
ggMarginal what dataset and variables to use, but of course this way you
Expand All @@ -145,7 +145,7 @@ text/font/theme/etc).

ggMarginal(data = mtcars, x = "wt", y = "mpg")

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-manual-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-manual-1.png" style="display: block; margin: auto;" />

Last but not least - you can also save the output from `ggMarginal` and
display it later. (This may sound trivial, but it was not an easy
Expand All @@ -155,7 +155,7 @@ discussion](http://stackoverflow.com/questions/29062766/store-output-from-gridex
p <- ggMarginal(p1)
p

<img src="vignettes/overview_files/figure-markdown_strict/ggmarginal-save-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/ggmarginal-save-1.png" style="display: block; margin: auto;" />

For more information, see `?ggExtra::ggMarginal`.

Expand All @@ -174,7 +174,7 @@ grid lines can be removed as well (default is to remove both).
p2 <- ggplot2::ggplot(df2, ggplot2::aes(x, y)) + ggplot2::geom_point()
p2 + removeGrid()

<img src="vignettes/overview_files/figure-markdown_strict/removeGrid-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/removeGrid-1.png" style="display: block; margin: auto;" />

For more information, see `?ggExtra::removeGrid`.

Expand All @@ -191,7 +191,7 @@ tick line.
p3 <- ggplot2::ggplot(df3, ggplot2::aes(x, y)) + ggplot2::geom_point()
p3 + rotateTextX()

<img src="vignettes/overview_files/figure-markdown_strict/rotateTextX-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/rotateTextX-1.png" style="display: block; margin: auto;" />

For more information, see `?ggExtra::rotateTextX`.

Expand All @@ -207,14 +207,14 @@ An example using a table:

plotCount(table(infert$education))

<img src="vignettes/overview_files/figure-markdown_strict/plotCount-table-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/plotCount-table-1.png" style="display: block; margin: auto;" />

An example using a data.frame:

df4 <- data.frame("vehicle" = c("bicycle", "car", "unicycle", "Boeing747"),
"NumWheels" = c(2, 4, 1, 16))
plotCount(df4) + removeGridX()

<img src="vignettes/overview_files/figure-markdown_strict/plotCount-df-1.png" style="display: block; margin: auto;" />
<img src="vignettes/ggExtra_files/figure-markdown_strict/plotCount-df-1.png" style="display: block; margin: auto;" />

For more information, see `?ggExtra::plotCount`.
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 5bbaa1f

Please sign in to comment.