Use R and Pelican on Windows

August 27, 2017

(This article was first published on Pachá (Batteries Included), and kindly contributed to R-bloggers)


On a previous post I explained how to install R and Python effortlessy.

Now I bought a Windows machine and this post gathers a lot of reading and experiments I made until I could set everything correctly to write this blog post. I use Pelican for my blog, so I had to do a few steps I wasn’t aware of in Windows.

What do you need to do this?

You’ll need Chocolatey installed and administrator access to Windows PowerShell. In this way an important part of path-related issues are solved.

Install R, Python and LaTeX

This part is easy. From PowerShell run:

choco install r.project python2 miktex

miktex is not needed for Pelican but I use a lot of Rmarkdown and LaTeX for my lectures.

Install Rtools

If you build packages or use packages such as devtools you need the Rtools for Windows. You can download the graphic installer from CRAN.

Install RStudio and GitHub Desktop

I just downloaded the graphic installers and this part this not need additional configurations.

Install Pelican, Markdown and rpy2

MathJax plugin presents problems with newer Pelican versions, so I’ll use Pelican 3.6.3 as in my post for OS X.

Run this from PowerShell:

pip install pelican==3.6.3 markdown

Before installing rpy2 you need to edit the system PATH. Go to the Control Panel and add this to the Path:

C:\Program Files\R\R-3.4.1\bin\x64

Then create the following variables:

R_HOME pointing to C:\Program Files\R\R-3.4.1
R_LIBS_USER pointing to C:\Users\pacha\Documents\R\win-library\3.4
R_USER with your user name

pip install rpy2 did not work in my case. After googling more than 10 minutes I found that the easiest option is to install it using UC Irvine‘s I got the version for Python 2.7 and then I did run:

pip install C:\Users\pacha\Downloads\rpy2-2.7.8-cp27-none-win_amd64.whl

Install R packages

If all of the above steps went well, you can open RStudio and run this:


And finally I was able to write blog entries without errors or warning on Windows!

To leave a comment for the author, please follow the link and comment on their blog: Pachá (Batteries Included). offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Comments are closed.

Search R-bloggers


Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)