nickmckay / LiPD-utilities

Input/output and manipulation utilities for LiPD files in Matlab, R and Python
http://nickmckay.github.io/LiPD-utilities/
GNU General Public License v2.0
28 stars 9 forks source link

filterTs() limitation #35

Closed hanskolus closed 5 years ago

hanskolus commented 6 years ago

Function doesn't appear to work with the OR symbol.

EX) filterTs(TS, 'interpretation1_variable == M | interpretation1_variable == M') returns list()

chrismheiser commented 6 years ago

Hi @hanskolus ,

Which language are you using this in? This function varies by language. In python you should be able to do a double query like that, but not in R.

Also, if you have a file I can test with that'd be great! It'd need to be a ZIP type.

hanskolus commented 6 years ago

Chris,

Thanks for checking in. I was using R. Do you want me to send you a LiPD file in ZIP format?

On Mon, Mar 5, 2018 at 7:44 PM, Christopher Heiser <notifications@github.com

wrote:

Hi @hanskolus https://github.com/hanskolus ,

Which language are you using this in? This function varies by language. In python you should be able to do a double query like that, but not in R.

Also, if you have a file I can test with that'd be great! It'd need to be a ZIP type.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nickmckay/LiPD-utilities/issues/35#issuecomment-370642889, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad1m1s-0nhwARp749oSeNPIR2Q2_Aicoks5tbff4gaJpZM4SRi-o .

chrismheiser commented 6 years ago

Yes that would be great. You can upload the file here if you rename the file with a .zip extension, or you can e-mail it to me at heiser@nau.edu

hanskolus commented 6 years ago

I've attached an example file. Thanks!

On Tue, Mar 6, 2018 at 10:10 AM, Christopher Heiser < notifications@github.com> wrote:

Yes that would be great. You can upload the file here if you rename the file with a .zip extension, or you can e-mail it to me at heiser@nau.edu

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nickmckay/LiPD-utilities/issues/35#issuecomment-370855002, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad1m1vbBnOUM9Byl5zng6MbDwb92IEQoks5tbsMAgaJpZM4SRi-o .

chrismheiser commented 6 years ago

I don't see a file attached. Would you mind giving it another try?

chrismheiser commented 6 years ago

I should note that if you are replying to the github e-mail notification I'm not sure if the attached files will get sent that way. I think you may need to post to the site page directly or send it to me via regular e-mail.

chrismheiser commented 6 years ago

Aden.Tierney.2013.lpd.zip file

chrismheiser commented 6 years ago

The current way to do it is to make two separate calls to filterTs, and group the results into a single list. Like this : new <- c(filterTs(ts, "interpretation == M"), filterTs(ts, "paleoData_variableName == dDwax"))

I'll see if I can find a simpler way to do it in R, but Python has easier ways to handle multi-expressions that R does not.

hanskolus commented 6 years ago

Great, thanks for the clarification!

On Tue, Mar 6, 2018 at 12:42 PM, Christopher Heiser < notifications@github.com> wrote:

The current way to do it is to make two separate calls to filterTs, and group the results into a single list. Like this : new <- c(filterTs(ts, "interpretation == M"), filterTs(ts, "paleoData_variableName == dDwax"))

I'll see if I can find a simpler way to do it in R, but Python has easier ways to handle multi-expressions that R does not.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nickmckay/LiPD-utilities/issues/35#issuecomment-370903293, or mute the thread https://github.com/notifications/unsubscribe-auth/Ad1m1hTVImPn0EE1lDYO07YiNhdJDwNhks5tbuajgaJpZM4SRi-o .

chrismheiser commented 5 years ago

This is no longer relevant. You can now make multiple queries in a single call by adding them to a list and giving that to the function. ie. filterTs(TS, list("query1", query2", ...))