Try this:

> myfunction <- function(){
+     # some calculations
+     # now get my name
+     .caller <- sys.call()
+     cat(paste(as.character(.caller[[length(.caller)]]),"needs 'xyz'\n"))
+ }
> myfunction()
myfunction needs 'xyz'
>
>



On 4/3/07, Johannes Graumann <johannes_graumann@web.de> wrote:
>
> Hello,
>
> For verbose coding I'd like to do something like:
> > myfunction <- function(x){
> >       if (a){
> >               stop(paste(myfunction_name_here,"requires xyz!")
> >       }
> Is that possible?
>
> Thanks for any hints, Joh
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



-- 
Jim Holtman
Cincinnati, OH
+1 513 646 9390

What is the problem you are trying to solve?

	[[alternative HTML version deleted]]

