Monthly Archives: March 2009

R tips: Swapping columns in a matrix

March 31, 2009
By
R tips: Swapping columns in a matrix

Swapping two columns in a matrix is really easy: m <- m.

Read more »

Enhanced tidy.source() (Preserve Some Comments)

March 31, 2009
By

After a few hours’ work, I modified the function tidy.source() in the animation package so that it can preserve complete comment lines. See the tidy.source() wiki page for example. tidy.source <- function(source = "clipboard", keep.comment = TRUE, keep.blank.line = FALSE, begin.comment, end.comment, ...) { # parse and deparse the code tidy.block = function(block.text)

Read more »

Multiple plot in a single image using ImageMagick

March 31, 2009
By
Multiple plot in a single image using ImageMagick

Sometimes you need to add several plots/images either by row or by column to a single page/sheet.If you generate all your plot with R base graphics you can easily accomplished the task using the par() function, e.g., using par(mfrow=c(2,2)) and then dr...

Read more »

How accurate or reliable are R calculations?

March 28, 2009
By
How accurate or reliable are R calculations?

On the REvolutions Blog there is a nice posting treating the often raised concern on “How good or reliable R is”. At my university R is hardly used. Sometimes I was asked by lecturers wether the calculations done by R and its packages are accurate. The linked posting treats this matter and tries to clarify

Read more »

R: Zip fastener for two data frames / combining rows or columns of two dataframes in an alternating manner

March 27, 2009
By
R: Zip fastener for two data frames / combining rows or columns of two dataframes in an alternating manner

Sometimes I find it useful to merge two data frames like the following ones   X1 X2 X3 X4 Y1 Y2 Y3 Y4 1  o  o  o  o X X X X 2  o  o  o  o X X X X 3  o  o  o  o X X X X by using zip feeding either

Read more »

R tips: Eliminating the “save workspace image” prompt on exit

March 26, 2009
By
R tips: Eliminating the “save workspace image” prompt on exit

When using R, the statistical analysis and computing platform, I find it really annoying that it always prompts to save the workspace when I exit. This is how I turn it off.

Read more »

R tips: Keep your packages up-to-date

March 25, 2009
By
R tips: Keep your packages up-to-date

In this entry in a small series of tips for the use of the R statistical analysis and computing tool, we look at how to keep your addon packages up-to-date.

Read more »

Alternative implementations using ggplot2

March 25, 2009
By
Alternative implementations using ggplot2

Here and here, you can find alternative implementations of two plots  (1, 2) I created time ago using R basic graphic. The author recreates the plots taking advantage of the excellent ggplot2 package.

Read more »

Inference for R

March 24, 2009
By
Inference for R

CREATE AUTOMATICALLY UPDATED R CHARTS AND TABLES INSIDE WORD & EXCEL Decision Science News’ imagination has been recently captured by an innovative product called Inference for R. (R as in the open-source language for statistical computation.) To use it, you simply insert some code into your Microsoft Office documents. The Inference product connects to the

Read more »

Comparison of different circle graphs

March 24, 2009
By

See in my Picasa here and get corrplot package here. Thanks Bob O'Hara's advice:)I found people's tastes differ, so input parameter col (fill color) and bg (background color) was added in new edition. What is more, now you can order your variables usin...

Read more »