Functions sort selected lines. And sort numbers as numbers not alphabetically.

rs_sort_rows(
  decreasing = FALSE,
  numeric.type = "decimal",
  context = rs_get_context()
)

rs_sort_rows_ascending(context = rs_get_context())

rs_sort_rows_descending(context = rs_get_context())

Arguments

decreasing

logical. Should the sort be increasing or decreasing? Note that descending=TRUE reverses the meanings of na.last and blanks.last.

numeric.type

either "decimal" (default) or "roman". Are numeric values represented as decimal numbers (numeric.type="decimal") or as Roman numerals (numeric.type="roman")?

context

(class document_context)
Object with context of active RStudio document.