I'm really confused hoping I'm doing something wrong on my end. I'm trying to use tidync in some of my own functions to help some co-workers working with some netCDF files. One of my functions basically just wraps up the below (ocean_time is the name of the dimension I'm trying to reference with str_dim):
t <- tidync(nc_path) %>% hyper_filter(str_dim = !! sym(str_dim) == 1800) %>% hyper_tibble()
now if i type this out with literals in the console like below it works:
t <- tidync(nc_path) %>% hyper_filter("ocean_time" = !! sym(str_dim) == 1800) %>% hyper_tibble()
but if I wrap this into a function and pass a string (str_dim = "ocean_time") as a parameter to it, I get this warning and the filter doesn't happen:
Warning message: In hyper_filter.tidync(., str_dim = !!sym(str_dim) == 1800) : 'str_dim' not found in active grid, ignoring
I have tried adding the !! sym(str_dim) before the = too but then i get this error:
Error: unexpected '=' in "t <- tnc %>% hyper_filter(!! sym(str_dim) ="