Organizing R Source Code

前端 未结 2 1352
梦毁少年i
梦毁少年i 2020-12-04 05:19

All,

I am starting to write object-oriented R code for the first time and anticipate having multiple R files with dependencies in between. I\'m new to R and have no

2条回答
  •  心在旅途
    2020-12-04 05:42

    this is for benefit of others who are directed to this post upon their search. I too faced exactly same scenario and found no resource which explained it clearly. Here is my attempt to put the solution in a few simple steps:
    1) Create a new project directory
    2) Create a Package via R studio(same process as above)
    3) Keep both in same location(to avoid confusion).
    4) Install and load packages: devtools and and roxygen2.
    5) use function load_all().

    And you are done.

提交回复
热议问题