Use dataset() function to get the current dataset name.
Add inherits=FALSE when checking for existence of .projectEnv on project .RData.