May 2018
Beginner to intermediate
364 pages
7h 43m
English
In R, we have several ways to sort data. The easiest way is to use the sort() function (see the code for the simplest one-dimensional data):
> set.seed(123) > x<-rnorm(100) > head(x) [1] -0.56047565 -0.23017749 1.55870831 0.07050839 0.12928774 1.71506499 > y<-sort(x) > head(y) [1] -2.309169 -1.966617 -1.686693 -1.548753 -1.265396 -1.265061
Let's look at another way to sort data. The dataset used is called nyseListing, which is included in the R package called fImport, shown here:
library(fImport) data(nyseListing) dim(nyseListing) head(nyseListing)
The output is shown here:

In total, we have 3,387 observations, each with 4
Read now
Unlock full access