Skip to content
Back to formatted view

Raw Message

Message-ID: <1358158887.7405.69.camel@dator219.stat.su.se>
Date: 2013-01-14T10:21:27Z
From: Feng Li
Subject: The three-dot question

Dear all,

Why does not the three-dot accept arguments from the parent environment?
I am just confused with this error, can someone give me a hint? 

> rm(list=ls())
> testFun <- function(a, ...)
+   {
+     if(a){
+         print(a)
+       }else
+       {
+         print(b)
+       }
+   }
> 
> myTask <- function(a)
+   {
+     b <- 3
+     testFun(a, b = b)
+   }
> myTask(FALSE)
Error in print(b) : object 'b' not found


Thanks in advance!

Feng

-- 
Feng Li
Department of Statistics
Stockholm University
SE-106 91 Stockholm, Sweden
http://feng.li/