If rank(x) gives you the ranks of x from lowest to highest, rank(-x) gives you the ranks from highest to lowest. Use the function mutate to add a column rank containing the rank, from highest to lowest murder rate. Make sure you redefine murders so we can keep using this variable.
With dplyr, we can use select to show only certain columns. For example, with this code we would only show the states and population sizes:
Use select to show the state names and abbreviations in murders. Do not redefine murders, just show the results.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here