Categories

Nov 4, 2019 in R Language

Q:

R Sort a Data Frame using Order()

1 Answer

Nov 4, 2019

In data analysis you can sort your data according to a certain variable in the dataset. In R, we can use the help of the function order(). In R, we can easily sort a vector of continuous variable or factor variable. Arranging the data can be of ascending or descending order.

Syntax:

sort(x, decreasing = FALSE, na.last = TRUE):

Argument:

  • x: A vector containing continuous or factor variable
  • decreasing: Control for the order of the sort method. By default, decreasing is set to `FALSE`.
  • last: Indicates whether the `NA` 's value should be put last or not
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
Jul 28, 2019 in R Language
Nov 6, 2019 in R Language
Jul 28, 2019 in R Language
...