ropensci / tidync

NetCDF exploration and data extraction
https://docs.ropensci.org/tidync
90 stars 12 forks source link

add multiple filtering of the same variable example to README #93

Closed everydayduffy closed 5 years ago

everydayduffy commented 5 years ago

Hi,

I was a bit stumped when trying to used multiple hyper_filter statements to select min/max lat/long values from an nc file. I found the following worked:

# coords in EPSG:4326
xmin <- -5
xmax <- 2
ymin <- 50
ymax <- 55

dat <- tidync::tidync(nc_file) %>%
    tidync::hyper_filter(longitude = longitude >= xmin & longitude <= xmax,
                         latitude = latitude >= ymin & latitude <= ymax)

whereas this did not:

dat <- tidync::tidync(nc_file) %>%
    tidync::hyper_filter(longitude = longitude >= xmin, 
                                  longitude = longitude <= xmax,
                                  latitude = latitude >= ymin, 
                                  latitude = latitude <= ymax)

I wondered if you could add something similar to my working example to your README, in case anyone else comes across the same thing.

Thanks for making a great package!

mdsumner commented 5 years ago

Ah thanks, that's right the named arguments must be unique. I'll add an example.

everydayduffy commented 5 years ago

Thank you