diff --git a/.Rbuildignore b/.Rbuildignore index 0153af8..906a280 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,5 @@ ^appveyor\.yml$ ^scripts/* ^misc/* +^ggthemr\.Rproj$ +^tic\.R$ diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..021c3b2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,58 @@ +# R for travis: see documentation at https://docs.travis-ci.com/user/languages/r +# Default configuration for use with tic package +# tic documentation to get started: https://ropenscilabs.github.io/tic/ +# Usually you shouldn't need to change the first part of the file + +# DO NOT CHANGE THE CODE BELOW +before_install: + - R -q -e 'if (!requireNamespace("remotes")) install.packages("remotes")' + - R -q -e 'if (getRversion() < "3.2" && !requireNamespace("curl")) install.packages("curl")' + - R -q -e 'remotes::install_github("ropenscilabs/tic", upgrade = "always"); print(tic::dsl_load()); tic::prepare_all_stages()' + - R -q -e 'tic::before_install()' +install: R -q -e 'tic::install()' +after_install: R -q -e 'tic::after_install()' +before_script: R -q -e 'tic::before_script()' +script: R -q -e 'tic::script()' +after_success: R -q -e 'tic::after_success()' +after_failure: R -q -e 'tic::after_failure()' +before_deploy: R -q -e 'tic::before_deploy()' +deploy: + provider: script + script: R -q -e 'tic::deploy()' + on: + all_branches: true +after_deploy: R -q -e 'tic::after_deploy()' +after_script: R -q -e 'tic::after_script()' +# DO NOT CHANGE THE CODE ABOVE + +# Custom parts: + +# Header +language: r +sudo: false +dist: xenial +cache: packages +latex: false + +#env +env: + global: + - MAKEFLAGS="-j 2" + +#jobs +jobs: + include: + - stage: test + r: devel + env: + - INSTALL_DEV_VERSIONS=true + - r: release + env: + - BUILD_PKGDOWN=true + +#matrix: Early abortion of failed builds +matrix: + fast_finish: true + +#services +services: diff --git a/README.Rmd b/README.Rmd index 780a5e7..4c702b3 100644 --- a/README.Rmd +++ b/README.Rmd @@ -26,6 +26,11 @@ source('scripts/preview_layout.R') ggthemr ======================================================== + +[![Travis build status](https://travis-ci.org/krlmlr/ggthemr.svg?branch=master)](https://travis-ci.org/krlmlr/ggthemr) +[![CRAN status](https://www.r-pkg.org/badges/version/ggthemr)](https://cran.r-project.org/package=ggthemr) + + Themes for ggplot2. The idea of this package is that you can just set the theme and then forget about it. You shouldn't have to change any of your existing code. There are several parts to a theme: * Colour palette for the background, axes, gridlines, text etc. diff --git a/README.md b/README.md index 3582422..607513a 100644 --- a/README.md +++ b/README.md @@ -15,19 +15,32 @@ ggthemr ======= -Themes for ggplot2. The idea of this package is that you can just set the theme and then forget about it. You shouldn't have to change any of your existing code. There are several parts to a theme: + +[![Travis build +status](https://travis-ci.org/krlmlr/ggthemr.svg?branch=master)](https://travis-ci.org/krlmlr/ggthemr) +[![CRAN +status](https://www.r-pkg.org/badges/version/ggthemr)](https://cran.r-project.org/package=ggthemr) + + +Themes for ggplot2. The idea of this package is that you can just set +the theme and then forget about it. You shouldn’t have to change any of +your existing code. There are several parts to a theme: - Colour palette for the background, axes, gridlines, text etc. - Layout of axes lines and gridlines. -- Spacing around plot and between elements (i.e. axes titles to axes lines etc). You can set the spacing to determine how compact or spread out a plot is. +- Spacing around plot and between elements (i.e. axes titles to axes + lines etc). You can set the spacing to determine how compact or + spread out a plot is. - Text size. -There are a number of preset palettes and layouts, and methods to create your own colour schemes. +There are a number of preset palettes and layouts, and methods to create +your own colour schemes. Installation ------------ -This package is still under development, but can be installed using [devtools](http://cran.r-project.org/web/packages/devtools/index.html). +This package is still under development, but can be installed using +[devtools](http://cran.r-project.org/web/packages/devtools/index.html). ``` r devtools::install_github('cttobin/ggthemr') @@ -42,7 +55,8 @@ To just set the colour scheme: ggthemr('dust') ``` -That's it. Any ggplot you create from then on will have the theme applied. You can clear the theme and return to ggplot2's default using: +That’s it. Any ggplot you create from then on will have the theme +applied. You can clear the theme and return to ggplot2’s default using: ``` r ggthemr_reset() @@ -51,9 +65,16 @@ ggthemr_reset() Palettes -------- -The palette determines the colours of everything in a plot including the background, layers, gridlines, title text, axes lines, axes text and axes titles. The *swatch* is the the name given to the set of colours strictly used in styling the geoms/layer elements (e.g. the points in `geom_point()`, bars in `geom_bar()` etc.). At least six colours have been supplied in each palette's swatch. +The palette determines the colours of everything in a plot including the +background, layers, gridlines, title text, axes lines, axes text and +axes titles. The *swatch* is the the name given to the set of colours +strictly used in styling the geoms/layer elements (e.g. the points in +`geom_point()`, bars in `geom_bar()` etc.). At least six colours have +been supplied in each palette’s swatch. -There are a wide variety of themes in this package (and more on the way). Some of them serious business... others are delibrately stylish and might not be that good for use in proper publications. +There are a wide variety of themes in this package (and more on the +way). Some of them serious business… others are delibrately stylish and +might not be that good for use in proper publications. ### flat @@ -130,7 +151,9 @@ There are a wide variety of themes in this package (and more on the way). Some o Custom Palettes --------------- -`define_palette()` lets you make your own themes that can be passed to `ggthemr()` just like any of the palettes above. Here's an example of a (probably ugly) palette using random colours: +`define_palette()` lets you make your own themes that can be passed to +`ggthemr()` just like any of the palettes above. Here’s an example of a +(probably ugly) palette using random colours: ``` r # Random colours that aren't white. @@ -149,12 +172,16 @@ example_plot + ggtitle(':(') ![](README_files/figure-markdown_github/unnamed-chunk-22-1.png) -You can define all elements of a palette using `define_palette()` including colours for the background, text, axes lines, swatch and gradients. +You can define all elements of a palette using `define_palette()` +including colours for the background, text, axes lines, swatch and +gradients. Layouts ------- -The layout of a theme controls the appearance and position of the axes, gridlines and text. Some folk prefer both major and minor gridlines, others prefer none or something in between. +The layout of a theme controls the appearance and position of the axes, +gridlines and text. Some folk prefer both major and minor gridlines, +others prefer none or something in between. ### Clean @@ -179,7 +206,10 @@ The layout of a theme controls the appearance and position of the axes, gridline Spacing ------- -Plot margins and space between axes titles and lines etc. is controlled with the *spacing* parameter. Lower values will make plots more compact, higher values will give them more padding. Compare the plots below where the spacing has been set to 0, 1 and 2 respectively. +Plot margins and space between axes titles and lines etc. is controlled +with the *spacing* parameter. Lower values will make plots more compact, +higher values will give them more padding. Compare the plots below where +the spacing has been set to 0, 1 and 2 respectively. ![](README_files/figure-markdown_github/unnamed-chunk-28-1.png) @@ -190,7 +220,9 @@ Plot margins and space between axes titles and lines etc. is controlled with the Type ---- -The *type* parameter can be set to either *inner* or *outer*. When *inner*, the background colour of a plot will not extend past the plot area. *outer* will colour the entire plot and background. +The *type* parameter can be set to either *inner* or *outer*. When +*inner*, the background colour of a plot will not extend past the plot +area. *outer* will colour the entire plot and background. ``` r ggthemr('earth', type = 'inner') @@ -209,7 +241,8 @@ example_plot Tweaking Themes --------------- -Squinting at a chart? Low on printer ink? ggthemr includes some methods to tweak charts to make them lighter or darker. Here's a standard theme: +Squinting at a chart? Low on printer ink? ggthemr includes some methods +to tweak charts to make them lighter or darker. Here’s a standard theme: ``` r ggthemr('dust') @@ -218,7 +251,8 @@ example_plot ![](README_files/figure-markdown_github/unnamed-chunk-33-1.png) -Maybe that plot comes out a bit pale looking when you print it. Here's how you can add a bit more contrast to the swatch: +Maybe that plot comes out a bit pale looking when you print it. Here’s +how you can add a bit more contrast to the swatch: ``` r darken_swatch(amount = 0.3) @@ -227,18 +261,25 @@ example_plot ![](README_files/figure-markdown_github/unnamed-chunk-34-1.png) -The second parameter to `darken_swatch()` controls the degree to which the colours are made darker. Full list of methods with similar functionality: +The second parameter to `darken_swatch()` controls the degree to which +the colours are made darker. Full list of methods with similar +functionality: -- `darken_swatch()` / `lighten_swatch()`: darker/lighter swatch colours. -- `darken_gradient()` / `lighten_gradient()`: darker/lighter gradient colours. +- `darken_swatch()` / `lighten_swatch()`: darker/lighter swatch + colours. +- `darken_gradient()` / `lighten_gradient()`: darker/lighter gradient + colours. - `darken_palette()` / `lighten_palette()`: darker/lighter everything. -I'll add methods to darken/lighten the axes lines and text soon too. +I’ll add methods to darken/lighten the axes lines and text soon too. Plot Adjustments ---------------- -Most of the time you'll probably just want to set the theme and not worry about it. There may be times though where you'll want to make some small adjustment, or manually change what items appear as what colour in a plot. +Most of the time you’ll probably just want to set the theme and not +worry about it. There may be times though where you’ll want to make some +small adjustment, or manually change what items appear as what colour in +a plot. ``` r ggthemr('dust') @@ -250,7 +291,12 @@ mpg_plot ![](README_files/figure-markdown_github/unnamed-chunk-35-1.png) -For some reason you decide you want to change those colours. Front-wheel drive vehicles should be orange. Rear-wheelers should be that red colour. You could change the order of the levels of your fill variable, but you shouldn't have to do that. You just want to switch those colours but you have no idea what they are. `swatch()` will give you the colours in the currently active ggthemr palette. +For some reason you decide you want to change those colours. Front-wheel +drive vehicles should be orange. Rear-wheelers should be that red +colour. You could change the order of the levels of your fill variable, +but you shouldn’t have to do that. You just want to switch those colours +but you have no idea what they are. `swatch()` will give you the colours +in the currently active ggthemr palette. ``` r swatch() @@ -270,18 +316,25 @@ mpg_plot + scale_fill_manual(values = rev(to_swap)) ![](README_files/figure-markdown_github/unnamed-chunk-37-1.png) -**Note:** the first colour in a swatch is a special one. It is reserved for outlining boxplots, text etc. So that's why the second and third colours were swapped. +**Note:** the first colour in a swatch is a special one. It is reserved +for outlining boxplots, text etc. So that’s why the second and third +colours were swapped. A note about theme setting -------------------------- ggthemr does three different things while setting a theme. -1. It updates the default ggplot2 theme with the specified ggthemr theme by using the `ggplot2::theme_set()` function. -2. It modifies the aesthetic defaults for all geoms using the `ggplot2::update_geom_defaults()` function. -3. It creates functions for all the different scales in the global environment. +1. It updates the default ggplot2 theme with the specified ggthemr + theme by using the `ggplot2::theme_set()` function. +2. It modifies the aesthetic defaults for all geoms using the + `ggplot2::update_geom_defaults()` function. +3. It creates functions for all the different scales in the global + environment. -In case, if you do not want to set the theme this way, use the `set_theme = FALSE` option while using the `ggthemr` function. An example of setting theme, geom aesthetic defaults and scales manually: +In case, if you do not want to set the theme this way, use the +`set_theme = FALSE` option while using the `ggthemr` function. An +example of setting theme, geom aesthetic defaults and scales manually: ``` r ggthemr_reset() diff --git a/README_files/figure-markdown_github/unnamed-chunk-10-1.png b/README_files/figure-markdown_github/unnamed-chunk-10-1.png index 3109836..6e468ba 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-10-1.png and b/README_files/figure-markdown_github/unnamed-chunk-10-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-11-1.png b/README_files/figure-markdown_github/unnamed-chunk-11-1.png index 8efc105..d0ddc01 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-11-1.png and b/README_files/figure-markdown_github/unnamed-chunk-11-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-12-1.png b/README_files/figure-markdown_github/unnamed-chunk-12-1.png index 1f0002d..2ab15c1 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-12-1.png and b/README_files/figure-markdown_github/unnamed-chunk-12-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-13-1.png b/README_files/figure-markdown_github/unnamed-chunk-13-1.png index 255a0d6..3f0b63e 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-13-1.png and b/README_files/figure-markdown_github/unnamed-chunk-13-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-14-1.png b/README_files/figure-markdown_github/unnamed-chunk-14-1.png index 96e7e83..79d8dfb 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-14-1.png and b/README_files/figure-markdown_github/unnamed-chunk-14-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-15-1.png b/README_files/figure-markdown_github/unnamed-chunk-15-1.png index 3fd4703..2178e31 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-15-1.png and b/README_files/figure-markdown_github/unnamed-chunk-15-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-16-1.png b/README_files/figure-markdown_github/unnamed-chunk-16-1.png index 9e35f78..924c4a7 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-16-1.png and b/README_files/figure-markdown_github/unnamed-chunk-16-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-17-1.png b/README_files/figure-markdown_github/unnamed-chunk-17-1.png index 5f265ea..8aab3de 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-17-1.png and b/README_files/figure-markdown_github/unnamed-chunk-17-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-18-1.png b/README_files/figure-markdown_github/unnamed-chunk-18-1.png index 83efa9f..76e1021 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-18-1.png and b/README_files/figure-markdown_github/unnamed-chunk-18-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-19-1.png b/README_files/figure-markdown_github/unnamed-chunk-19-1.png index 6e56387..b62e3a9 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-19-1.png and b/README_files/figure-markdown_github/unnamed-chunk-19-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-20-1.png b/README_files/figure-markdown_github/unnamed-chunk-20-1.png index 718695b..25701f4 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-20-1.png and b/README_files/figure-markdown_github/unnamed-chunk-20-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-21-1.png b/README_files/figure-markdown_github/unnamed-chunk-21-1.png index b869d05..3055414 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-21-1.png and b/README_files/figure-markdown_github/unnamed-chunk-21-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-22-1.png b/README_files/figure-markdown_github/unnamed-chunk-22-1.png index a8c44e7..8fe9b19 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-22-1.png and b/README_files/figure-markdown_github/unnamed-chunk-22-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-23-1.png b/README_files/figure-markdown_github/unnamed-chunk-23-1.png index 827c098..cb023f7 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-23-1.png and b/README_files/figure-markdown_github/unnamed-chunk-23-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-24-1.png b/README_files/figure-markdown_github/unnamed-chunk-24-1.png index ec84ed5..7a9071d 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-24-1.png and b/README_files/figure-markdown_github/unnamed-chunk-24-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-25-1.png b/README_files/figure-markdown_github/unnamed-chunk-25-1.png index 827c098..cb023f7 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-25-1.png and b/README_files/figure-markdown_github/unnamed-chunk-25-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-26-1.png b/README_files/figure-markdown_github/unnamed-chunk-26-1.png index bc4ab1e..e6b41cb 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-26-1.png and b/README_files/figure-markdown_github/unnamed-chunk-26-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-27-1.png b/README_files/figure-markdown_github/unnamed-chunk-27-1.png index a87adc9..6e18506 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-27-1.png and b/README_files/figure-markdown_github/unnamed-chunk-27-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-28-1.png b/README_files/figure-markdown_github/unnamed-chunk-28-1.png index e22158e..7f7e2b1 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-28-1.png and b/README_files/figure-markdown_github/unnamed-chunk-28-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-29-1.png b/README_files/figure-markdown_github/unnamed-chunk-29-1.png index 191b2ca..94934ae 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-29-1.png and b/README_files/figure-markdown_github/unnamed-chunk-29-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-30-1.png b/README_files/figure-markdown_github/unnamed-chunk-30-1.png index ab5f7c7..6fb708d 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-30-1.png and b/README_files/figure-markdown_github/unnamed-chunk-30-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-31-1.png b/README_files/figure-markdown_github/unnamed-chunk-31-1.png index 12f1127..9ec2f9f 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-31-1.png and b/README_files/figure-markdown_github/unnamed-chunk-31-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-32-1.png b/README_files/figure-markdown_github/unnamed-chunk-32-1.png index 429bb28..8c07708 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-32-1.png and b/README_files/figure-markdown_github/unnamed-chunk-32-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-33-1.png b/README_files/figure-markdown_github/unnamed-chunk-33-1.png index b5161af..336a9e1 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-33-1.png and b/README_files/figure-markdown_github/unnamed-chunk-33-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-34-1.png b/README_files/figure-markdown_github/unnamed-chunk-34-1.png index 5b7a3f3..336a9e1 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-34-1.png and b/README_files/figure-markdown_github/unnamed-chunk-34-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-35-1.png b/README_files/figure-markdown_github/unnamed-chunk-35-1.png index a868de9..279648f 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-35-1.png and b/README_files/figure-markdown_github/unnamed-chunk-35-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-37-1.png b/README_files/figure-markdown_github/unnamed-chunk-37-1.png index fd2b9d5..ce1a8f9 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-37-1.png and b/README_files/figure-markdown_github/unnamed-chunk-37-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-38-1.png b/README_files/figure-markdown_github/unnamed-chunk-38-1.png index b7f6aea..055e690 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-38-1.png and b/README_files/figure-markdown_github/unnamed-chunk-38-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-38-2.png b/README_files/figure-markdown_github/unnamed-chunk-38-2.png index 86b7874..ded5775 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-38-2.png and b/README_files/figure-markdown_github/unnamed-chunk-38-2.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-38-3.png b/README_files/figure-markdown_github/unnamed-chunk-38-3.png index e5264d6..f35d024 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-38-3.png and b/README_files/figure-markdown_github/unnamed-chunk-38-3.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-38-4.png b/README_files/figure-markdown_github/unnamed-chunk-38-4.png index a022e9a..1742070 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-38-4.png and b/README_files/figure-markdown_github/unnamed-chunk-38-4.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-5-1.png b/README_files/figure-markdown_github/unnamed-chunk-5-1.png index 62b5d49..f3757ac 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-5-1.png and b/README_files/figure-markdown_github/unnamed-chunk-5-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-6-1.png b/README_files/figure-markdown_github/unnamed-chunk-6-1.png index 00bed74..2afb89e 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-6-1.png and b/README_files/figure-markdown_github/unnamed-chunk-6-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-7-1.png b/README_files/figure-markdown_github/unnamed-chunk-7-1.png index 32128f3..d2ed369 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-7-1.png and b/README_files/figure-markdown_github/unnamed-chunk-7-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-8-1.png b/README_files/figure-markdown_github/unnamed-chunk-8-1.png index c31581b..af6b907 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-8-1.png and b/README_files/figure-markdown_github/unnamed-chunk-8-1.png differ diff --git a/README_files/figure-markdown_github/unnamed-chunk-9-1.png b/README_files/figure-markdown_github/unnamed-chunk-9-1.png index 62fb4ac..c08bbe8 100644 Binary files a/README_files/figure-markdown_github/unnamed-chunk-9-1.png and b/README_files/figure-markdown_github/unnamed-chunk-9-1.png differ diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..b38b219 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,66 @@ +# DO NOT CHANGE the "init" and "install" sections below + +# Download script file from GitHub +init: + ps: | + $ErrorActionPreference = "Stop" + Invoke-WebRequest http://raw.github.com/krlmlr/r-appveyor/master/scripts/appveyor-tool.ps1 -OutFile "..\appveyor-tool.ps1" + Import-Module '..\appveyor-tool.ps1' + +install: + - ps: Bootstrap + - cmd: Rscript -e "writeLines('options(repos = \'https://cloud.r-project.org\')', '~/.Rprofile')" + - cmd: Rscript -e "getOption('repos')" + - cmd: Rscript -e "if (!requireNamespace('remotes')) install.packages('remotes')" + - cmd: Rscript -e "if (getRversion() < '3.2' && !requireNamespace('curl')) install.packages('curl')" + - cmd: Rscript -e "remotes::install_cran('tic', type = 'binary', upgrade = 'always'); print(tic::dsl_load()); tic::prepare_all_stages()" + +cache: +- C:\RLibrary + +before_build: Rscript -e "tic::before_install()" +build_script: Rscript -e "tic::install()" +after_build: Rscript -e "tic::after_install()" +before_test: Rscript -e "tic::before_script()" +test_script: Rscript -e "tic::script()" +on_success: Rscript -e "try(tic::after_success(), silent = TRUE)" +on_failure: Rscript -e "tic::after_failure()" +before_deploy: Rscript -e "tic::before_deploy()" +deploy_script: Rscript -e "tic::deploy()" +after_deploy: Rscript -e "tic::after_deploy()" +on_finish: Rscript -e "tic::after_script()" + +# Adapt as necessary starting from here + +#on_failure: +# - 7z a failure.zip *.Rcheck\* +# - appveyor PushArtifact failure.zip + +environment: + # R_QPDF=true makes sure that R CMD check doesn't complain + # about a missing qpdf executable + R_QPDF: "true" + # The example below will not work for your repository, + # you need to encrypt your own token. + # Please follow https://ci.appveyor.com/tools/encrypt . + #GITHUB_PAT: + # secure: VXO22OHLkl4YhVIomSMwCZyOTx03Xf2WICaVng9xH7gISlAg8a+qrt1DtFtk8sK5 + +artifacts: + - path: '*.Rcheck\**\*.log' + name: Logs + + - path: '*.Rcheck\**\*.out' + name: Logs + + - path: '*.Rcheck\**\*.fail' + name: Logs + + - path: '*.Rcheck\**\*.Rout' + name: Logs + + - path: '\*_*.tar.gz' + name: Bits + + - path: '\*_*.zip' + name: Bits diff --git a/tic.R b/tic.R new file mode 100644 index 0000000..7d51768 --- /dev/null +++ b/tic.R @@ -0,0 +1,13 @@ +if (ci_has_env("INSTALL_DEV_VERSIONS")) { + get_stage("install") %>% + add_step(step_install_github(c("r-lib/scales", "tidyverse/ggplot2"))) +} + +do_package_checks() + +if (ci_on_travis() && ci_has_env("BUILD_PKGDOWN")) { + get_stage("install") %>% + add_step(step_install_cran("gridExtra")) + + do_pkgdown() +}