title: Automatically finding the path of current R project in R Studio
body: <p>Say I have an R project opened at the following directory <code>/home/user/workarea/project1</code>. Now I have a nested directory structure underneath and I am writing a function that is supposed to perform logging from anywhere inside this project and I want this function to write into files that are located at the directory <code>/home/user/workarea/project1/log</code>. I plan to pass the file path as an argument to this function. Now I know that this file will always be located under the /log directory in the project's main directory - but how do I automatically find out which is my project directory, so that I don't always specify relative paths with <code>..</code>. I wouldn't want to hard-code my local path <code>/home/user/workare/project1</code>, but be able to detect this wherever I clone my project. </p>