animals
speed | color | |
---|---|---|
Elephant | 40 | Gray |
Cheetah | 120 | Tan |
Tortoise | 0.1 | Green |
Hare | 48 | Grey |
Lion | 80 | Tan |
Polar Bear | 30 | White |
Source: http://www.speedofanimals.com
Questions:
- Extract the
speed
of 40 km/h. - Return the rows with
color
of Tan. - Return the rows with
speed
greater than 50 km/h and output only thecolor
column. Keep the output as a data frame. - Change the color of “Grey” to “Gray”.
To work with the animals.csv
file, you can right-click here and download it to the data
folder.
Next, read it in using the following: ~animals <- read.csv("data/animals.csv")
~
animals <- read.csv("data/animals.csv", row.names=1)