Re: [Rd] Ellipsis to Two Functions When One Has Nested Functions

2014-05-28 Thread Brian Lee Yung Rowe
Another option is to use a closure, which isolates the arguments explicitly. aFunction <- function(data, alpha, ...) { transform(alpha, ...) rowMeans(data) > alpha } f <- function(data, selection, ...) { selected <- selection(data) # Remove ellipsis from here plot(data[selected, ], ..

Re: [Rd] Ellipsis to Two Functions When One Has Nested Functions

2014-05-28 Thread Brian Lee Yung Rowe
Another option is to use a closure, which isolates the arguments explicitly. aFunction <- function(data, alpha, ...) { transform(alpha, ...) rowMeans(data) > alpha } f <- function(data, selection, ...) { selected <- selection(data) # Remove ellipsis from here plot(data[selected, ], ..

Re: [Rd] Ellipsis to Two Functions When One Has Nested Functions

2014-05-28 Thread Duncan Murdoch
On 28/05/2014, 2:00 AM, Dario Strbenac wrote: Hello If I have a function aFunction <- function(data, alpha, ...) { transform(alpha, ...) rowMeans(data) > alpha } f <- function(data, selection, ...) { selected <- selection(data, ...) plot(data[selected, ], ...) } f(aDataset

[Rd] Ellipsis to Two Functions When One Has Nested Functions

2014-05-27 Thread Dario Strbenac
Hello If I have a function aFunction <- function(data, alpha, ...) { transform(alpha, ...) rowMeans(data) > alpha } f <- function(data, selection, ...) { selected <- selection(data, ...) plot(data[selected, ], ...) } f(aDataset, aFunction, alpha = 10, pch = 19, transform = sqrt)