Set working directory to appDir to honor .Rprofile, .Renviron, and .RData which are placed inside an app's directory.