Re: [R] subtract a list of vectors from a list of data.frames in an elegant way

2012-03-31 Thread Gabor Grothendieck
On Thu, Mar 29, 2012 at 4:28 AM, Eric Fail wrote: > Dear R experts, > > I've realized that it might not be possible to define a negative SELCET > statement in a SQL call so now I'm looking for the smoothest way to generate > a list of what I would like from my large database by first pulling all

Re: [R] subtract a list of vectors from a list of data.frames in an elegant way

2012-03-31 Thread Henrique Dallazuanna
Try this: mapply('[', DBquery, mapply(setdiff, lapply(DBquery, names), lookup)) On Sat, Mar 31, 2012 at 5:50 PM, Eric Fail wrote: > a working solution to the problem, > >  a <- DBquery[names(lookup)] > > mother.of.lookup <- list() > for(string in names(a)) { >   a[[string]] <- names(a[[string]])

Re: [R] subtract a list of vectors from a list of data.frames in an elegant way

2012-03-31 Thread Eric Fail
a working solution to the problem, a <- DBquery[names(lookup)] mother.of.lookup <- list() for(string in names(a)) { a[[string]] <- names(a[[string]]) mother.of.lookup[[string]] <- setdiff(a[[string]], lookup[[string]]) } identical(mother.of.lookup, result) It might not be the most elegan

Re: [R] subtract a list of vectors from a list of data.frames in an elegant way

2012-03-29 Thread Jim Holtman
?setdiff Sent from my iPad On Mar 29, 2012, at 4:28, "Eric Fail" wrote: > Dear R experts, > > I've realized that it might not be possible to define a negative SELCET > statement in a SQL call so now I'm looking for the smoothest way to generate > a list of what I would like from my large dat

[R] subtract a list of vectors from a list of data.frames in an elegant way

2012-03-29 Thread Eric Fail
Dear R experts, I've realized that it might not be possible to define a negative SELCET statement in a SQL call so now I'm looking for the smoothest way to generate a list of what I would like from my large database by first pulling all the names with a query like this "SELECT top 1 * FROM your