# 9-3 - Ordering rows in a dataframe

# The data is held in the file FullPatientNumbers.csv

# This is within the SP09 folder of the current working directory
# The file contains headers

# Load FullPatientNumbers.csv file

patients<-read.csv("SP09/FullPatientNumbers.csv", header=TRUE)

# Display patients

patients

# Order by Attendances
# NB We are ordering the rows so we need the final comma
# Increasing order (default)

patients[order(patients$Attendances),]

# Order by Under4Percentage
# NB We are ordering the rows so we need the final comma
# Decreasing order

patients[order(patients$Under4Percentage, decreasing=TRUE),]
