Re: [R] passing arguments to subset from a function

2008-12-17 Thread Vitalie S.
On Wed, 17 Dec 2008 20:07:08 +0100, GOUACHE David wrote: argument which I will pass on to subset() somewhere inside my function. I would use the example of .() function from plyr package in this case: .<-function (...){ structure(as.list(match.call()[-1]), class = "quoted") } myfuncti

Re: [R] passing arguments to subset from a function

2008-12-17 Thread iverson
This thread may help? https://stat.ethz.ch/pipermail/r-help/2007-November/145345.html On Wed, 17 Dec 2008 20:07:08 +0100, "GOUACHE David" wrote: > Hello R-helpers, > > I'm writing a long function in which I manipulate a certain number of > datasets. I want the arguments of said function to allo

Re: [R] passing arguments to subset from a function

2008-12-17 Thread baptiste auguie
I wrote a dirty hack last time I faced this problem, I'll be curious to see what is the proper way of dealing with the scoping and evaluation rules. library(datasets) myfunction<-function(table, extraction) { table2<-subset(table,extraction) return(table2) } condition1 <- quote(iris$S

Re: [R] passing arguments to subset from a function

2008-12-17 Thread David Winsemius
Available free for the typing are the functions for the default and the dataframe methods of subset: > subset.default function (x, subset, ...) { if (!is.logical(subset)) stop("'subset' must be logical") x[subset & !is.na(subset)] } > subset.data.frame function (x, subset, se

[R] passing arguments to subset from a function

2008-12-17 Thread GOUACHE David
Hello R-helpers, I'm writing a long function in which I manipulate a certain number of datasets. I want the arguments of said function to allow me to adapt the way I do this. Among other things, I want my function to have an argument which I will pass on to subset() somewhere inside my functio