Avoiding Side Effects

If your functions needs to do any of the following actions you need to clean up afterwards:

  • Create a file or directory
  • Create a resource on an external system
  • Set an R option
  • Set an environment variable
  • Change working directory
  • Change an aspect of the tested package’s state