#pull out the animals which are dogsanimaldata[animaldata$Animal.Type == “Dog” ] # throuws an error
Error in `[.data.frame`(animaldata, animaldata$Animal.Type == “Dog”): undefined columns selectedTraceback:1. animaldata[animaldata$Animal.Type == “Dog”]2. `[.data.frame`(animaldata, animaldata$Animal.Type == “Dog”)3. stop(“undefined columns selected”)
In [8]:
#fixed erroranimaldata[animaldata$Animal.Type == “Dog”, ] # missedout comma with in the bracket
Some of it is basic syntax; others are a bit nastier.