# R support on Windows

**URL:** <https://travis-ci.community/t/r-support-on-windows/3953>\
**Category:** Windows\
**Tags:** r\
**Created:** [June 28, 2019, 2:06am UTC](https://travis-ci.community/t/r-support-on-windows/3953 "2019-06-28T02:06:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rwetherall](https://avatars.discourse-cdn.com/v4/letter/r/bcef8e/32.png) [@rwetherall](https://travis-ci.community/u/rwetherall)\
**Post date:** [June 28, 2019, 2:06am UTC](https://travis-ci.community/t/r-support-on-windows/3953/1 "2019-06-28T02:06:00Z")

</div>

Hi!

R support for windows would be amazing! Then I can ditch Appveyor which never seems to work!!

Cheers,  
Roy

---

<div class="post-metadata">

**Author:** ![jayvdb](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/jayvdb/32/1966_2.png) [@jayvdb](https://travis-ci.community/u/jayvdb)\
**Post date:** [June 29, 2019, 12:19pm UTC](https://travis-ci.community/t/r-support-on-windows/3953/2 "2019-06-29T12:19:34Z")

</div>

I have R support for Travis Ubuntu, Travis Windows, and Appveyor, _without_ package compilation. And also Gitlab CI with images of most common distros. See [https://github.com/coala/coala-bears/pull/2910](https://github.com/coala/coala-bears/pull/2910) and [https://gitlab.com/coala/package\_manager/pipelines/68370247](https://gitlab.com/coala/package_manager/pipelines/68370247)

A useful trick is set env var `R_COMPILE_AND_INSTALL_PACKAGES=never`, which speeds up any dependencies and removes the requirement to have compilers working.

If your own package needs compilers, this wont work.

If you could post the URL to your project, we might be able to help you get it working.

---

<div class="post-metadata">

**Author:** ![caiohamamura](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/caiohamamura/32/4020_2.png) [@caiohamamura](https://travis-ci.community/u/caiohamamura)\
**Post date:** [March 12, 2020, 3:11am UTC](https://travis-ci.community/t/r-support-on-windows/3953/3 "2020-03-12T03:11:04Z")

</div>

Try that, and you need to include oledlg.dll in your repository or provide a curl download for it:

```
os: windows
language: bash

cache:
    directories:
    - $HOME/AppData/Local/Temp/chocolatey

install:
 - choco install -y r --version 3.6.2
 - choco install -y rtools --version 3.5.0.4
 - "url=$(curl https://miktex.org/download | sed -n 's/.*href=.\\(.*x64.exe\\).*/https:\\/\\/miktex.org\\1/p' | head -1)"
 - if ! [-f $HOME/AppData/Local/Temp/chocolatey/miktex.exe]; then
   curl -Lo $HOME/AppData/Local/Temp/chocolatey/miktex.exe $url;
   fi
 - $HOME/AppData/Local/Temp/chocolatey/miktex.exe --unattended --auto-install=yes 
 - "export PATH=/c/Program\\ Files/MiKTeX\\ 2.9/miktex/bin/x64:$PATH"
 - choco install -y pandoc
 - "export PATH=/c/Program\\ Files/R/R-3.6.2/bin/x64:/c/Rtools/bin:/c/RTools/mingw_64/bin:$PATH"
 - mkdir -p ${HOME}/Documents/R/win-library/3.6
 - export R_LIBS_USER=${HOME}/Documents/R/win-library/3.6
 - echo 'options(repos = c(CRAN = "https://cloud.r-project.org"))' > .Rprofile
 - Rscript -e 'install.packages("devtools")'
 - Rscript -e 'install.packages(c("remotes"));if (!all(c("remotes") %in% installed.packages())) { q(status = 1, save = "no")}'
 - "Rscript -e 'deps <- remotes::dev_package_deps(dependencies = NA);remotes::install_deps(dependencies = TRUE);if (!all(deps$package %in% installed.packages())) { message(\"missing: \", paste(setdiff(deps$package, installed.packages()), collapse=\", \")); q(status = 1, save = \"no\")}'"

script:
- R CMD build .
- R CMD check *tar.gz --as-cran
```
