Hello,

 

I have quite a few programs that I have written over the last 5 years
that rely on the old R engine (2.6.2 and earlier) returning a null when
an invalid index is used, as in:

 

> df <- data.frame(x = 1)

> df[,'y']

NULL

 

Is there a way to tell R to return NULLs instead of raising errors
within a function or package? I'm a fan of the raising errors instead of
returning values that could be confused with a legitimate return value,
but for now I'm stuck using 2.6.2 until I have time to check every line
of code I've written in the last 5 years.

 

Thanks!

 

Jason Thorpe


	[[alternative HTML version deleted]]

