I have a data frame function whose output is too lengthy which is being used as an output in a r shiny app. I want to spilt this by field fac. How could I do it. So I want tables which has fac= A and so on for the unique fields in fac. Thank you.
prod()
x y fac
1 1 1 C
2 1 2 B
3 1 3 B
4 1 4 B
5 1 5 A
6 1 6 B
7 1 7 B
8 1 8 C
9 1 9 C
10 1 10 C
I am not familiar with the i4imisc package so I can't comment on that, but how are you saving the output of the loop? You may need to construct an empty list and fill it as you loop through lst. Printing this list may reveal the problem.
I am not sure whether lst()$Category[i] is what you need or lst()[[i]]$Category...
assuming you want all of these tables to be rendered dynamically based on the number of different fac levels, you could use map (which is essentially, an efficient for loop) along with renderTable, renderUI and tableOutput:
You will need to load dplyr and purrr packages for the filter and map functions, respecitvely.