FM_pretty_sort: Centralized Sorting Function

View source: R/formods.R

FM_pretty_sortR Documentation

Centralized Sorting Function

Description

When displaying information in a pull down this function can be used to sort those options.

Usage

FM_pretty_sort(unsrt_data)

Arguments

unsrt_data

Unsorted data.

Value

sorted data

Examples

# This is the full path to a test data file:
data_file_local  =  system.file(package="formods", "test_data", "TEST_DATA.xlsx")
# Excel files need a sheet specification:
sheet           = "DATA"
# We will also attach the sheets along with it
df = readxl::read_excel(path=data_file_local, sheet=sheet)
# Regular sorting:
sort(unique(df$Cohort))
FM_pretty_sort(unique(df$Cohort))

formods documentation built on April 12, 2025, 1:57 a.m.