0

I have 4 groups within my h5 file such that the following code:

list.datasets(spot_sims)
= [1] "/Apple/2018" "/Apple/2019" "/IBM/2018" "/IBM/2019"

How can I query only the IBM group without having to use index numbers?

E.g. I have tried variations of the following:

list.datasets(spot_sims)["\\IBM"]
S_C
  • 37
  • 8
  • 1
    Try with `grep` i.e. `grep("IBM", list.datasets(spot_sims), value = TRUE)` – akrun Jan 15 '18 at 07:36
  • How can I alter the above query to obtain the data within the list, e.g. something similar to `for (i in 1:simulated_years) { assign(paste0("spot_y", i), spot_sims[list.datasets(spot_sims)[i]][]) }` – S_C Jan 15 '18 at 23:07

0 Answers0