From termcc at googlemail.com  Tue Mar 20 11:36:09 2007
From: termcc at googlemail.com (Thomas McCallum)
Date: Tue, 20 Mar 2007 10:36:09 +0000
Subject: [Rd] Symbol and Ellipsis problems
Message-ID: <5a7daaf70703200336i7889cf8ft8be3b145750fcdac@mail.gmail.com>

Hi Everyone,

When I have a load of functions which have various arguments passed
via the ellipsis argument it keeps on assigning them as symbol making
them unusable to the function.  My current work around involves using
do.call but this is rather cumbersome.

Does anyone know why it suddenly changes the types to symbol and if
there is a way to get the actual data pointed to by the symbol? (I
have tried eval but that does not work and most functions just treat a
symbol as a string).

( An example which shows the type conversion is given below with the
output - the key is the following "dataX=data" which makes the object
data passed as a symbol and not the actual data).

Many thanks

Tom

====EXAMPLE CODE====
data=c(1,2,3,4,5,6,7,8,9);

x <- function( ... ) {
        args <- list();
        extras <- match.call(expand.dots = FALSE)$...;
        for( i in names(extras) ) {
                args[[ i ]] <- extras[[ i ]];
                print(args[[i]]);
                print(typeof(extras[[i]]));
        }


}

cat("TYPE OF DATA:");
print(typeof(data));
x(dataX=data);



[Rd] Symbol and Ellipsis problems
Thomas McCallum