Skip to content

Commit 5b544f6

Browse files
20250724 - sort data
1 parent 9de181d commit 5b544f6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

dataManagement.Rmd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,16 @@ head(mydata)
472472
head(mydata$age)
473473
```
474474

475+
# Sort Data {#sec-sortData}
476+
477+
```{r}
478+
mydata %>%
479+
arrange(survived, age) #sort by survived (ascending) then by age (ascending)
480+
481+
mydata %>%
482+
arrange(survived, -age) #sort by survived (ascending) then by age (descending)
483+
```
484+
475485
# Data Characteristics {#dataCharacteristics}
476486

477487
## Data Structure

0 commit comments

Comments
 (0)