In my last post I have discussed how to work around GNU R scoping rules using environment function. This time let us look at a practical example using recode function from car package.First let us look at how&nbs...

In my last post I have discussed how to work around GNU R scoping rules using environment function. This time let us look at a practical example using recode function from car package.First let us look at how&nbs...

By design GNU R uses lexical scoping. Fortunately it allows for at least two ways to simulate dynamic scoping.Let us start with the example code and next analyze it:x <- "global"f1 <- function() cat("f1:", x, "\n")f2 <- function() cat("f2:", e...

In my last post I have shown a solution to classical sorting problem in R. So I thought that this time it would be nice to generate a strategy for playing Mastermind using R.It was shown by D.E. Knuth that Mastermind code can be bro...

Recently I have stumbled on a problem with split function applied on list of factors. The issue is that it might produce wrong splits when splitting factors contain dots.Here is the example of the problem. Invoking the following code:df <-...

e-mails with the latest R posts.

(You will not see this message again.)