sort_num_chr: Sort numerical character according to the numbers that the...

View source: R/sort_num_chr.R

sort_num_chrR Documentation

Sort numerical character according to the numbers that the character values represent.

Description

Just a convenience function often used to sort patient IDs by numerical value while being considered as factor though.

Usage

sort_num_chr(x, decreasing = F)

Arguments

x

vector of character or factor which represent numbers

decreasing

logical, sort decreasing

Value

character vector of sorted values

Examples

sort_num_chr(c("3", "4", "2"))
sort_num_chr(as.factor(c("3", "4", "2")))

Close-your-eyes/fcexpr documentation built on Sept. 29, 2023, 12:27 a.m.