From the data (Cereal) in Lock5data, how can I create a function that, when supplying the arguments: calories and fat shows the name of the cereal as output?
For example: suppose that the function named Flakes has already been created and when applied:
library(Lock5Data)
data(Cereal)
Hojuelas(Cereal, calories =117, fat= 0.6)
I should throw as a result:
"Applejacks"
which corresponds to the cereal for those specific arguments
Thanks for your help.