Load the dplyr package and the murders dataset.
You can add columns using the dplyr function mutate. This function is aware of the column names and inside the function you can call them unquoted:
We can write population rather than murders$population. The function mutate knows we are grabbing columns from murders.
Use the function mutate to add a murders column named rate with the per 100,000 murder rate as in the example code above. Make sure you redefine murders as done in the example code above ( murders <->
->
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here