Displaying 3 results from an estimated 3 matches for "functions_with_arg".
2005 Dec 26
1
Seg fault with trace
...d then spend ages trying to figure out why it
doesn't work when I use the function with a single column. The idea of
the functions below is to automatically warn me when I do something
like that.
trace_all <- function(fs, tracer) {
sapply(fs, trace, tracer=tracer, print=FALSE)
return()
}
functions_with_arg <- function(arg, pos) {
fs <- ls(pos=pos)
present <- unlist(lapply(fs, function(x) is.function(get(x)) &&
!is.null(formals(x)[[arg]])))
fs[present]
}
trace_all(list("sum"), quote(if (!na.rm) warning("na.rm = FALSE")))
# Works
trace_all(functions_with_arg(...
2009 Oct 20
2
Is there a way to specify drop=FALSE as the global default?
tmp <- matrix(1:2)
tmp
tmp[,1,drop=FALSE]
See the above example. Is there a way to make 'drop=FALSE' as global
default, so that when I say 'tmp[,1]', R will treat it as
'tmp[,1,drop=FALSE]'?
2006 May 04
3
New-user support package - suggestions?
Dear Community,
This is largely a repost with some new information.
I'm interested in developing a package that could ease the
command-line learning curve for new users. It would provide more
detailed syntax checking and commentary as feedback. It would try to
anticipate common new-user errors, and provide feedback to help
correct them.
As a trivial example, instead of
>