Ten Steps to Building an R package under Windows

If you’ve spent any amount of time working in R there comes a point when you want to create your own package in R.  I’ve switched back and forth between running R on my MAC and running it on Windows and I thought I’d give package development on Windows a try.  What I’ll try to do on these pages is document that process step by step for the raw beginner.

First off, I need to thank all the R experts who have help put all the tools and documentation in place. Without them none of this would be possible.

How to Build a Package in Windows

Use the guide below to jump to any section you want. I’ll take you through the entire process as I did it.

Step One:  Update your R and other Tools. We will start by updating our version of R and I’ll update my current version of RStudio. Neither of these steps are difficult and you can just skip this section as you should already be familiar with these types of tasks.

Step  Two: Get to know your Windows System

Step Three:  Decide which kind of package  you want to build

Step Four:  Get the tools

Step Five:   Installing the tools

Step Six:  Fixing your Path

Step Seven: Reboot and do some reading

Step Eight;  The Sample Package

Step Nine: Edit some files

Step Ten: Build

  1. David McKeever
    October 9, 2011 at 1:23 PM

    Very interesting and informative. I was wondering if you think that someone (like me) could download comma separated files (.csv) from a horse racing website that has data from past performances using your build steps. I would be interested in doing things like time series, and econometric techniques applied to horse racing. Any comments appreciated.

  2. steven mosher
    October 9, 2011 at 8:50 PM

    yes, but you dont need to build a package. Just get R and download the file

  3. Oleg M
    December 18, 2011 at 4:37 AM

    This is very helpful. I am making my first steps trying to build C code into my R programs. Most other places (like R documentation on CRAN) skip a lot of these, for example the nature of R CMD. Thank you Steve!

  4. Dinesh
    May 2, 2012 at 3:55 AM

    This is the best ever documentation for creating “R packages using Windows”. Simple and to the point. Thanks Steve. This was very helpful.

    • Steven Mosher
      May 2, 2012 at 3:57 AM

      you are welcomed. Let others know if they have problems

  5. January 18, 2013 at 2:40 PM

    Hello to every one, for the reason that I am really keen
    of reading this webpage’s post to be updated regularly. It includes nice information.

  6. July 16, 2013 at 10:12 PM

    Its such as you learn my mind! You seem to understand so much approximately
    this, such as you wrote the ebook in it or something.
    I think that you just could do with a few % to power the message house a little bit,
    but other than that, this is fantastic blog. An excellent read.
    I will definitely be back.

  7. October 18, 2013 at 8:10 PM

    Hi Steve, thanks for the tutorial. I followed your ways and edited the path carefully. However, when I ran “R CMD build mypkg” in command prompt, it said “C:\ Program is not recognized as an external….”. I tried to fix this problem by surfing online, but still got stuck on this. Do you have any idea on this. Thanks!!!

  8. October 27, 2013 at 8:13 AM

    Hi! I found your tutorial very useful. I am writing my dissertation about a package I published thanks to this tutorial. I will acknowledge your work on it. Thank you!

    • Steven Mosher
      October 28, 2013 at 2:04 AM

      Wow thank you

  9. March 20, 2014 at 10:09 PM

    Asking questions are really nice thing if you are not understanding something
    totally, but this paragraph presents fastidious understanding even.

  1. June 9, 2011 at 12:20 AM
  2. May 23, 2012 at 9:17 PM
  3. August 11, 2012 at 8:53 PM
  4. March 2, 2013 at 5:03 AM
  5. June 22, 2014 at 9:32 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 36 other followers

%d bloggers like this: