I want to create a "value-frequency" table from the following expression.
Counts[Sort[RandomInteger[{1, 5}, 500]]] // TableForm
The generated table should be in LaTeX form either
- two rows and n columns. first row: Value, second row: Frequency
- n rows and 2 columns. first column: Value, second column: Frequency
Optionally with headings "Value" and "Frequency" to make it look nice.
How to achieve this?