Skip to contents

Animal Sounds Test Package

This package contains a single function, animal_sounds. It was developed as part of the Forwards R Package Development workshops.

The animal_sounds function takes two arguments:

  • animal: character, the name of an animal
  • sound: character, the sound made by the animal
animal_sounds("cow", "moo")
## [1] "The cow says moo!"

The sound argument is optional.

animal_sounds("polar bear")
## [1] "The polar bear makes no sound."