filmov
tv
Arrange in R - Sort a Dataframe by a Column in R
![preview_player](https://i.ytimg.com/vi/j7SqaJv-i8k/maxresdefault.jpg)
Показать описание
Often times, we'll want to present our data in an organized way. Whether it's just to print out a csv file, or to take a look to make sure your data doesn't have any issues.
Regardless, ordering your data frame in R requires just a few simple lines of code! By using the arrange() function in R, we can sort our data frame by a particular column and specify if we want it in ascending or descending order.
Within dplyr, you may also be grouping your data set and want to preserve that grouping before sorting. Not to worry, it's easy not only to sort by two columns in r, but also to make a slight modification to the default arguments of the arrange function to preserve the grouping you previously specified.
If you like this content and want to see more videos in the Using R series to help you up your R game, be sure to let me know what questions you want to see me address in the comments below.
'Til next time, happy R'ing!
Intro: 00:00
Roadmap: 00:20
Arrange by One Column: 00:45
Arrange in Descending Order: 01:20
Arrange by 2 Columns: 02:20
Grouped Data Sets: 03:31
Outro: 04:55
Regardless, ordering your data frame in R requires just a few simple lines of code! By using the arrange() function in R, we can sort our data frame by a particular column and specify if we want it in ascending or descending order.
Within dplyr, you may also be grouping your data set and want to preserve that grouping before sorting. Not to worry, it's easy not only to sort by two columns in r, but also to make a slight modification to the default arguments of the arrange function to preserve the grouping you previously specified.
If you like this content and want to see more videos in the Using R series to help you up your R game, be sure to let me know what questions you want to see me address in the comments below.
'Til next time, happy R'ing!
Intro: 00:00
Roadmap: 00:20
Arrange by One Column: 00:45
Arrange in Descending Order: 01:20
Arrange by 2 Columns: 02:20
Grouped Data Sets: 03:31
Outro: 04:55