Crunch-io / rcrunch

R package for interacting with the Crunch API
https://crunch.io/r/crunch/
GNU Lesser General Public License v3.0
9 stars 15 forks source link

Allow me to subset my cube dimensions by category name #297

Open jonkeane opened 6 years ago

jonkeane commented 6 years ago

With our current [ methods for CrunchCubes, I can subset by index:

> cat_by_mr
          zoo
fruit      alligator     oryx capybara
  rambutan   8.46015 17.23266 26.39342
  satsuma   14.50712 28.54626 60.57941
> cat_by_mr[, c(1, 3)]
          zoo
fruit      alligator capybara
  rambutan   8.46015 26.39342
  satsuma   14.50712 60.57941

But, if I try by names I get

> cat_by_mr[, c("alligator", "capybara")]
Error in numeric(0)[drop = TRUE, fruit = TRUE, zoo = TRUE, zoo = 1L] : 
  (subscript) logical subscript too long
In addition: Warning message:
In out[visible] <- `*vtmp*` :
  number of items to replace is not a multiple of replacement length
gergness commented 4 years ago

low reward high risk