NREL / rplexos

Other
18 stars 13 forks source link

Query Master Filters #39

Closed BenjaminWatts closed 9 years ago

BenjaminWatts commented 9 years ago

This is such a great package - it makes my life so much easier!

One thing I am trying to do at the moment is to pass filters dynamically to a query_master command, using the shiny app.

So I have a character vector in R with a list of the names of Generators or regions. Sometimes this will contain some values, sometimes it will be empty.

I'd like to pass this to a query master command and slot it in where the asterixs are.

query_master(db, time.range = daterange, time = input$TimePeriod, prop = input$Property, phase = phase, col = input$Collection, filter = *****())

Is there a simple way to do this? I've tried playing around with wildcards, and parsing text, but can't find a solution to what seems like it should be really simple!

eibanez commented 9 years ago

Use filter = list(name = YourCharacterVector)

BenjaminWatts commented 9 years ago

Thanks ever so much - is there a wildcard I can use in place of "YourCharacterVector"?

eibanez commented 9 years ago

No, if you apply the filter you should have a vector with the actual strings that you want to use. If you don't want to apply that filter, I would check your vector first and apply a query with or without the filter.

BenjaminWatts commented 9 years ago

Ah OK no worries. Thanks! On 9 Sep 2015 14:13, "Eduardo Ibanez" notifications@github.com wrote:

No, if you apply the filter you should have a vector with the actual strings that you want to use. If you don't want to apply that filter, I would check your vector first and apply a query with or without the filter.

— Reply to this email directly or view it on GitHub https://github.com/NREL/rplexos/issues/39#issuecomment-138905287.