6

I have created an rpivottable and my problem with it is that when it runs, I can't click on one of the options on the side bar to filter out a specific factor because it says there are too many to list.

Pivottable:

enter image description here

And then when I click on Ad.Source, this comes up:

enter image description here

This is a problem, because if I want to create line graphs by clicking on the dropdown menu "Table", it won't allow me to create the graph because there are too many factors and I can't even filter it out to make it presentable.

When creating a pivottable in R, is there a way to override this so that it can list an unlimited amount or atleast an amount higher than 1000, so that I can filter out multiple factors?

Thanks

mnist
  • 6,571
  • 1
  • 18
  • 41
R Guru
  • 171
  • 1
  • 12

1 Answers1

10

rpivotTable is sort of a wrapper around a js library pivotTable. Here you can find all its parameters. Try using the one called menuLimit, for example:

tmp <- rbind(iris, iris)
# Here you have limit on num column:
rpivotTable(cbind(tmp, num = 1:dim(tmp)[1]))
# Here you don't:
rpivotTable(cbind(tmp, num = 1:dim(tmp)[1]), menuLimit = 500)

You could also filter the data before putting it into rivotTable (or group it into less buckets).

langusta
  • 368
  • 2
  • 7
  • I don't know `javascript` at all. Could you extend a bit your answer? I mean, how to add `js` file to my `shiny app` and how to write `js` file? I've tried to add it somehow, but I failed :( But thanks, anyway, I'm sure now, that it is possible :D – Marta Jan 20 '16 at 09:28
  • I've added an example. You don't need to use js at all :P `rpivotTable` has `...` argument through which you can pass parameters that `pivotUI` accepts. – langusta Jan 20 '16 at 10:20
  • No problem. @Marta how do you know that I'm Karol? – langusta Jan 20 '16 at 15:12
  • @langusta Thank you! No idea how much you are saving me here. – R Guru Jan 20 '16 at 18:28