This article describes how to go from an unsorted table...
..to a table that is sorted using R:
Requirements
- A table with one column and multiple rows.
Method
1. Select your table.
2. From the object inspector , copy the name from General > Name.
3. From the toolbar, go to Calculation > Custom Code.
4. Click on the page to place the custom output.
5. In the R code editor, 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)]
UPCOMING WEBINAR: The Roadmap for Market Researchers in the Age of AI