[R] transportable code?

Spencer Graves spencer.graves at pdf.com
Thu Feb 20 20:31:03 CET 2003

As an extension of the recent discussion of "functions different in R 
and S", what suggestions do people have for writing transportable code 
for R/S beyond Venables and Ripley (2000, S Programming, pp. 202-203)?

For example, I recently found myself using the following construct:

	if(version$major < 5){
#		Function oldClass was introduced with the "new S"
#		and is not present in R or S-Plus 2000
		oldClass <- class

Similarly, I plan to define a function "gsub" 

Do these seem reasonable?  Are there other suggestions / standard / 
compilations of thoughts?

Spencer Graves

More information about the R-help mailing list