JoeDumoulin / CrimeDataAnalysis

Repo for INRUG experiments using crime data.
4 stars 7 forks source link

Create ezknitr template that deals with importing data file and working directory #12

Open ckogan opened 7 years ago

rparrish commented 7 years ago

The problem we're trying to address is that the default working directory for .Rmd files is the location of the file. This is great when all the .Rmd files are in a flat file structure, but we've been trying to organize our analysis projects in sub-folders.

This may not be as straight-forward as I first hoped. If we use the ezknitr approach, then we may be trading one inconvenience for others. The main problem is that ezknitr is run from the console, so we lose the knit button and preview functions in RStudio.

Interestingly, this topic has been discussed in the past few days on Twitter by a number of high-profile individuals in the R community, including the developer of knitr. There are work-arounds but not a simple or recommended best practice.

Q about @rstudio/#rstats: why is the working directory for Rmd files the file location, not project directory? Is there a way to alter that?

Based on all of this, I now think that we should abandon the use of individual subfolders in this, our first collaborative project. Instead, we should keep the .Rmd files and output files in a flat file structure, all located in the project root directory.

ckogan commented 7 years ago

I'm happy switching to that format Rollie.

Regards, Clark

On Oct 9, 2016 9:27 AM, "Rollie Parrish" notifications@github.com wrote:

The problem we're trying to address is that the default working directory for .Rmd files is the location of the file. This is great when all the .Rmd files are in a flat file structure, but we've been trying to organize our analysis projects in sub-folders.

This may not be as straight-forward as I first hoped. If we use the ezknitr approach, then we may be trading one inconvenience for others. The main problem is that ezknitr is run from the console, so we lose the knit button and preview functions in RStudio.

Interestingly, this topic has been discussed in the past few days on Twitter by a number of high-profile individuals in the R community, including the developer of knitr. There are work-arounds but not a simple or recommended best practice.

Q about @rstudio/#rstats: why is the working directory for Rmd files the file location, not project directory? Is there a way to alter that?

Based on all of this, I now think that we should abandon the use of individual subfolders in this, our first collaborative project. Instead, we should keep the .Rmd files and output files in a flat file structure, all located in the project root directory.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/JoeDumoulin/CrimeDataAnalysis/issues/12#issuecomment-252496377, or mute the thread https://github.com/notifications/unsubscribe-auth/AG-8P7vSEJzyCJ13x1iicdRntc3GC0iiks5qyRXmgaJpZM4KRycD .