Create a table/grid/matrix? from a dataframe?

I have a dataframe that I want to covert to (still very new to R so I really don't know what to call it) a grid\table?

So something like below:
DF to Table

So I can know the proper terminology, what is my final structure called in R in the above example?

This is created via a LP model that I do some joins to related tables, the end goal is to display the final product (i.e. the weekly schedule) in a shiny interface. So if I can completely bypass the R functions and use some Shiny specific stuff that would be fine. My first goal was to get it in that format.

Thanks

Check out pivot_wider in tidyr:

YES!!! I thought it would be some kind of pivot. Thanks!! I have my table now.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.