Question: > creatures c(dog, cat, armadillo, human) > friendly = c(TRUE, TRUE, FALSE, TRUE) > diet = c(cats, mice, termites, Twinkies (tm) ) > waking.hours =
> creatures c("dog", "cat", "armadillo", "human")
> friendly = c(TRUE, TRUE, FALSE, TRUE)
> diet = c("cats", "mice", "termites", "Twinkies (tm) ")
> 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]
Use R subset function to create a data frame consisting of just the creature name and diet associated with friendly creatures who are more than 12 hours a day from the data frame creature.data
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
