How to build an R package in Windows

Let’s suppose you ‘re in the mood to create an R package and then upload it to CRAN as an ideal way of making sure others have access to your work. I don’t know if the following guide will really help you cause the R package mechanism is rather complex, but I’m quite sure it’ll be better than nothing.

A. Toolbox (necessary pieces of software you have to install first)

0. Latest version of R.
1. rtools: a minimal set of Unix utilities
2. ActivePerl: a scripting language
3. MinGW: Compiler system, uses GCC to produce Windows programs
4. Microsoft’s HTML Compiler: It’s called htmlhelp.exe and includes hhc.exe
5. A version of TeX (I use MiKTeX)

B. Change your Windows Path “environmental variable”

To set the path, right click on the “My Computer” icon on your desktop. Choose properties and click on the “advanced” tab. Click the environmental variables button and you will see a new window. Change the system variable “Path”. To do so, click on the variable and select the edit button. Change the path so that the directories containing MikTeX, Rtools, minGW, perl, R and the html help compiler. You will need to be very careful to type the path names correctly. See below for an example of the beginning of the path as set on my machine:

C:\Perl\site\bin;C:\Perl\bin;C:\Program Files\R\R-2.10.1\bin;c:\Rtools\bin;c:\Rtools\MinGW\bin;c:\Perl\bin;C:\Program Files\MiKTeX 2.7\miktex\bin

Restart your machine.

C. Build your hello package (eventually)

- Open a “Command Prompt” window. Check if path is correct (type path).
- Run R through the command prompt (type R)
- Type package.skeleton("hello",code_="hello.r")
- Exit R (type q() )
(the hello directory was created and now you have to carefully edit the DESCRIPTION file which is under the hello directory and the hello.Rd file which is under the man directory, search for examples of these files in other package installations, you can find plenty of them in the lib directory, which is under your R installation directory)

- Back to the command prompt window, type R CMD build hello (hello.tar.gz was created)
- Type R CMD INSTALL --build hello (hello.zip was created)
- Type R CMD check hello for an extensive check of your package installation

In the unlikely event that everything went fine so far (no errors, no warnings) you just have to upload the hello.tar.gz file to ftp://cran.r-project.org/incoming/ and send an email to cran@r-project.org that you did it. Otherwise, google the bad news and hope for the best.

Other resources for building R packages:
[Making packages under Windows]
[Creating R packages: a tutorial]
[An introduction to the R package mechanism]
[Create packages for R]

Buzzdigmeblogspacedeliciousgoogle bookmarks

Popularity: 1% [?]

Serious vs Solemn

Later today, I watched the above inspiring talk by Paula Scher @ TedTalks, titled “Great design is serious (not solemn)”.

Paula Scher looks back at a life in design and pinpoints the moments when she started really having fun. According to Scher, you play or gamble when you take fascinating jobs you have no idea what they are about. These jobs are the ’serious’ ones. However, later on, some of them become solemn or extra serious.
But being ’serious’ about something, says Scher, is very different from being solemn–when you’re solemn, it isn’t all play anymore.

I can easily find an analogy to this as regards my work. I’ve started working on Collaborative Filtering for Recommendation Systems almost a year ago. At first it was a job for fun and profit. Now I think it’s becoming solemn. A paper is on its way to AIAI09, an Artificial Intelligence Conference and a startup at early stage. Definitely, not a walk in the park anymore.

So if you ever feel yourself in that same situation, try go back to that time of being youthful and arrogant, taking jobs where you have no idea what you’re talking about, and get serious.

Buzzdigmeblogspacedeliciousgoogle bookmarks

Popularity: 63% [?]

The Classification Song

english, Επιστήμη — amarkos @ 16:34

Looking forward to my talk at the IFCS 2009 Conference, on the 15th of March. To get a better idea of the event, I suggest listening to the Classification Song which wonderfully summarizes (and praises) the primary scientific areas of Data Analysis.

[audio:http://www.amarkos.gr/blog/wp-content/uploads/2009/01/classification.mp3]
The Classification Song

(After Mozart’s “Bastien und Bastienne”, 4th Scene, No.8)

Lyrics: Claus Weihs
Singer: Claus Weihs
Piano: Julia Schiffner

We are here to praise together:
Classification, Data Analysis,
With this song to show their strengths
Classification, Data Analysis,
Support progress mathematic’lly,
mathematic’lly.
We have learned classes are fuzzy,
and regression is outdated,
So, we are modern now
applying Art’ficial Neural Nets
And Support Vector Machines.

Replace trees by random forests,
do not use the good old err’r rates
but turn over to ideal features.
Be as modern as you can,
Be as modern as you can,
And invent clever involved theories
Just forget interpretation
and be optimal instead.

We are here to praise together:
Classification, Data Analysis,
With this song to show their strengths
Classification, Data Analysis,
Support progress mathematic’lly,
mathematic’lly.
We apply our newest methods
to all fields of science now,
econometrics, biometrics,
even music, linguistics,
and archaeology.

Let us link these different fields
To make clear our ubiquity
And our indispensability.
So, remember all the time,
That our methods have to be applied,
Thus, take care of practical tools.
And prepare interpretation,
Be as simple as you can.

[via]

Buzzdigmeblogspacedeliciousgoogle bookmarks

Popularity: 56% [?]

Next Page »
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.
(c) 2010 amarkos|gr|blog | powered by WordPress with Barecity