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,,t...

When creating a subset of a dataframe, I often exclude rows based on the level of a factor. However, the "levels" of the factor remain intact. This is the intended behavior of R, but it can cause problems in some cases. I finally discovered how to clean up levels in this post to R-Help. Here is an example:>...

When creating a subset of a dataframe, I often exclude rows based on the level of a factor. However, the "levels" of the factor remain intact. This is the intended behavior of R, but it can cause problems in some cases. I finally discovered how to clean up levels in this post to R-Help. Here is an example: >...

Since the release of R_2.6.0, R package developers were advised to use the ``codetools" package to check potential bugs. However, as I am not familiar with computer language, I found the warning messages a bit confusing. For example:> checkUsage(glm.fit): no visible binding for global variable ‘n’I don't understand what it really means. Apparently, `n' was not globally defined but...

The GGobi book is now available from Springer and Amazon, after quite a delay. Getting the figures printed correctly was difficult. Solutions to the exercises in the back of each chapter are available for instructors by emailing Springer.The movies on ...

The GGobi book is now available from Springer and Amazon, after quite a delay. Getting the figures printed correctly was difficult. Solutions to the exercises in the back of each chapter are available for instructors by emailing Springer.The movies on ...

RKN over at Epidemiology blog had a small problem he solved using simulation:I have been interested in the following question: if there are, let's say, 5 genes involved in the liability of fx risk, and each gene has two alleles with one of them conferr...

I was trying to plot figure in R like the one below, which is basically the veto player model of Tsebelis. Based on my knowledge of R now, I encountered 2 major problems:I don't know if there is a function that can draw archs, or at least partial curves from circles.I don't know if there is a good way...

SIMPLE WAYS TO DETECT AND COMMUNICATE STATISTICAL EFFECTS Decision Science News is fond of heuristics and the Simonian view that for many problems organisms face, optimization is a fiction and satisficing makes us smart. Statistics is an area in which it is easy to see precision that isn’t there and find “optima” in problems that

Developers of statnet, a collection of packages for R for fitting Exponential Random Graph Models (ERGM), issued a major update. First change is that the main package is now called ergm. Secondly, a set of additional packages has been made available. Apart from package network, that provides a class system for relational data on which

Learning the programming in the new S4 system of classes and methods in R can be quite cumbersome, even though the methods package is very well documented. That is why I collected some of the info and materials that I am aware of on a separate page here. I warmly welcome any suggestions for extending

?rollmean (package=zoo)?rollmedian (package=zoo)?runmed (package=stats)

Our Christmas tree has not been decorated yet, but the presents are there: the BMC Bioinformatics paper on userscripts in life sciences, Bioclipse 1.2.0, a long list of blogs to rate, and a very nice overview from Wendy Warr on workflow environments, d...

If you have a vector of factors it is easy to get the factor level; however, I always forget how to extract the factor value. I ran into the answer here.> x<-factor(c(round(rnorm(10),2),"A","B",NA))> x 1.61 1.12 1.26 0.09 -0.13 0.16 -0.03 -0.1 0.09 -0.47 A ...

If you have a vector of factors it is easy to get the factor level; however, I always forget how to extract the factor value. I ran into the answer here. > x<-factor(c(round(rnorm(10),2),"A","B",NA))> x 1.61 1.12 1.26 0.09 -0.13 0.16 -0.03 -0.1 0.09 -0.47 A ...

The Applied Bioinformatics at PRI group where I now work in Wageningen and the group of Steffen Neumann in Halle have started the MetWare project on Sourceforge to develop opensource databases for metabolomics data.The databases design will be based on...

During my PhD I wrote a simple but effective genetic algorithm package for R. Because there was a bug recently found, and there is interest in extending the functionality, I have set up a SourceForge project called genalg.The package provides GA support for binary and real-value chromosomes (and integer chromosomes is something that will be...

The plotting capabilities of R are excellent; however, when I am preparing a figure for publication, I often need to combine multiple plots or add objects (e.g., arrows or text) to an existing plot. While this can be accomplished in R, my patience for ...

The plotting capabilities of R are excellent; however, when I am preparing a figure for publication, I often need to combine multiple plots or add objects (e.g., arrows or text) to an existing plot. While this can be accomplished in R, my patience for ...

The plm package for R lets you run a number of common panel data models, including The fixed effects (or within) estimator The random effects GLS estimator It also allows for general GLS estimation, as well as GMM estimation, and includes a feature for heteroscedasticity consistent covariance estimation. It’s very easy to use, it simply