1. Engineering
  2. Computer Science
  3. function description given a character vector containing the names of...

Question: function description given a character vector containing the names of...

Question details

Function Description: Given a character vector containing the names of all the animals on Tech Green, write a function that counts how many times the word chicken occurs. Lastly, the search should be case insensitive, meaning that you should ignore whether letters are uppercase or lowercase when searching through the string. Example: field - hoRse cHiCken whale g00se plAtypUS doge LoBster ChickenLittle numcount ThoseChickens (field) num2 Notes: The word chicken can appear within other words, too. For example, chickens. Hints: The strfind) function might come in handyFunction Description: Given a character vector containing the names of all the animals on Tech Green, write a function that counts how many times the word chicken occurs. Lastly, the search should be case insensitive, meaning that you should ignore whether letters are uppercase or lowercase when searching through the string. Example: field hoRse cHicken whale goose plAtypUS doge LoBster Chicken Little num = countThoseChickens(field) num → 2 Notes: The word chicken can appear within other words, too. For example, chickens. Hines: The strfind() function might come in handy

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution