Publications by Rob J Hyndman

Debugging in R

30.08.2007

Anyone who starts writing serious R code (i.e., code that involves user-written functions) soon finds the need to use debugging tools. There are a few basic tools in R that are worth knowing about. The function debug() allows one to step through the execution of a function, line by line. At any point, you can print out values of variables or prod...

1620 sym

Organization and R

05.09.2007

Many R users seem to get themselves in a bit of a mess with R files and workspaces scattered across different directories. The R files themselves also get messy and hard to follow. So here is some advice on keeping organized with R: Try to keep code strictly indented based on the code structure such as loops, if statements, etc. Every left bra...

2251 sym

R graph with two y-axes

04.02.2008

I’ve been asked how to do this several times, so I thought it might help to put an example online. x <- 1:5 y1 <- rnorm(5) y2 <- rnorm(5,20) par(mar=c(5,4,4,5)+.1) plot(x,y1,type="l",col="red") par(new=TRUE) plot(x, y2,,type="l",col="blue",xaxt="n",yaxt="n",xlab="",ylab="") axis(4) mtext("y2",side=4,line=3) legend("topleft",col=c("red","blue"),...

527 sym R (273 sym/1 pcs) 2 img

R books

30.07.2008

Amazon.com Widgets Related To leave a comment for the author, please follow the link and comment on their blog: "R-bloggers" via Tal Galili in Google Reader. R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job. Want ...

446 sym

Time series packages on R

16.10.2008

There is now an official CRAN Task View for Time Series. This will replace my earlier list of time series packages for R, and provide a more visible and useful entry point for people wanting to use R for time series analysis. If I have missed anything on the list, please let me know. Related To leave a comment for the author, please follow the ...

711 sym

Building R packages for Windows

13.07.2009

1. Installing the required tools To build an R package in Windows, you will need to install some additional software tools. These are summarized at http://www.murdoch-sutherland.com/Rtools 1.1 Essential: Rtools This is a collection of unix-like tools that can be run from the DOS command prompt. It also contains the MinGW compilers that are use...

5152 sym Python (1277 sym/9 pcs) 2 tbl

R help on StackOverflow

23.08.2009

Ever since I began using R about ten years ago, the best place to find R help was on the R-help mailing list. But it is time-consuming searching through the archives trying to find something from a long time ago, and there is no way to sort out the good advice from the bad advice. But now there is a new tool and it is very neat. Head over to the ...

1324 sym

Finding an R function

13.09.2009

Suppose you want a function to fit a neural network. What’s the best way to find it? Here are three steps that help to find the elusive function relatively quickly. First, use help.search("neural") or the shorthand ??neural. This will search the help files of installed packages for the word “neural”. Actually, fuzzy matching is used so it r...

2080 sym R (376 sym/2 pcs)

Workflow in R

17.09.2009

This came up recently on StackOverflow. One of the answers was particularly helpful and I plan to adopt this for my future work. In fact, it is close to what I already do, but is a little more structured. The idea is to break the code into four files, all stored in your project directory. These four files are to be processed in the following orde...

2926 sym

Using Google Reader

15.02.2010

Google Reader is a fantastic way to keep track of new papers that are appearing in many different journals, and also to follow some of the interesting research blogs (and blogs on other topics) that are out there. Google Reader checks websites for you and lets you know of any new material that appears. Instead of you having to look at dozens of ...

3566 sym 4 img