risks of using setwd() in a script?

前端 未结 6 2150
抹茶落季
抹茶落季 2020-12-04 15:59

I\'ve heard it said that it is bad practice to use setwd() in a script.

  • What are the risks/dangers associated with it?
  • What are bett
6条回答
  •  旧时难觅i
    2020-12-04 16:40

    Toward the better alternatives question:

    I mainly use R for individual projects (meaning I'm the primary analyst). However, we do use these in projects which sometimes need to be shared with others.

    RStudio - Projects

    I have found RStudio's Projects functionality goes a long way to keeping your files organized. If other users also adopt RStudio, they will have the nice feeling of being able to open a single file ("*.Rproj") and have the project load in the same state you last saved it to.

    ProjectTemplate

    On top of this, I've found a new tool, ProjectTemplate that goes a step further! The technique the author developed is used to provide structure to what you are doing. Please go over to the website for more detail.

提交回复
热议问题