Question: Use the creature.data data frame for this exercise. Write R Code to extract the waking hours for a dog using two different R commands. creatures

Use the creature.data data frame for this exercise. Write R Code to extract the waking hours for a dog using two different R commands.

creatures = c("dog","cat","armadillo","human")

friendly = c(TRUE, TRUE, FALSE, TRUE)

diet = c("anything","mice","termites","pizza")

waking.hours = c(13.9, 11.5, 5.9, 16.0)

creature.data = data.frame(friendly, diet, waking.hours, row.names=creatures)

creatures[creature.data$waking.hours < 12 & !creature.data$friendly]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!