pt <- pivot_table(df_ex)
pt <- pivot_table(df_ex, page = "M4")
pt <- pivot_table(df_ex, page_row = 1, page_col = 1)
pt <- pivot_table(df_ex, page_row = 1, page_col = 1, n_col_labels = 2, n_row_labels = 2)
Run the code above in your browser using DataLab