Re: [R] New-user support package - suggestions?

From: hadley wickham <>
Date: Thu 04 May 2006 - 23:09:44 EST

I started on such a project a while ago for my personal use when creating packages. Often I forget to use na.rm and never test my functions with code containing missing values, and then later on have to search back through my code and ensure I've used na.rm=TRUE everywhere.

I didn't get very far, because at that point my code was segfaulting R on the mac. I've just re-looked at my code and it seems to run ok now. This might at least get you started:

trace_all <- function(fs, tracer) {

	sapply(fs, trace, tracer=tracer, print=FALSE)


functions_with_arg <- function(arg, pos) {

	fs <- ls(pos=pos)
	present <- unlist(lapply(fs, function(x) is.function(get(x)) && 


#trace_all(list("sum"), quote(if (!na.rm) warning("na.rm = FALSE")))

#trace_all(functions_with_arg("na.rm", "package:base"), quote(if (!na.rm) warning("na.rm = FALSE")))

Other functionality I'd like to see in such a package (from my needs as a developer) would be:

But they should take about 15 minutes to implement, so I'm not sure what you'd do for the rest of the 6 weeks.

Hadley mailing list PLEASE do read the posting guide! Received on Thu May 04 23:15:27 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Fri 05 May 2006 - 00:10:11 EST.

Mailing list information is available at Please read the posting guide before posting to the list.