Introduction
This article describes how to go from an unsorted table...
..to a table that is sorted.
Requirements
- A table with one column and multiple rows.
Method
1. Right click on your table and select Reference name.
2. Copy the table name and click OK.
3. Right click in the Report tree and select Add R Output.
4. Go to Properties > R CODE in the object inspector.
5. Add a line to the code that defines the table as table = table_name
where table_name is copied from step 2.
6. Add this line to the code to sort in descending order: table[order(table, decreasing = TRUE)]
Below is the code from this example that sorts in decreasing order:
table = table.Preferred.cola
table = table[order(table, decreasing = TRUE)]
Next
How to Sort Multiple Column Tables Using R
How to Export Updatable Text to PowerPoint using R
How to Relabel Rows and Columns in an R Table