I am working on a making a package in RStudio. I already have it as a project, and I am using Git for version control. My directory structure is currently
--Project
--R
--.git
With the R code in the R
directory.
My problem occurs when I go to build the package. I want to call the package "Project" and I get the a directory structure like this:
--Project
--R
--.git
--Project
--man
--R
And in this setup there are two sets of R files, on in each "R" directory. The less nested one is being versioned by Git, the more nested one is the source for the package. Is there some way to get the package to just use the preexisting "R" directory? Can I just reanme my current "Project" directory to something else, make the package as "Project" and then copy the .git directory to the new Project directory?
When a new project is created RStudio: Creates a project file (with an . Rproj extension) within the project directory. This file contains various project options (discussed below) and can also be used as a shortcut for opening the project directly from the filesystem.
In RStudio (I'm using v. 1.0.136), this can be done via the menu options Tools > Project Options > Build Tools. Select Package from the drop-down list for Project build tools, and if you know what you're doing, fill in any of the other fields as you deem appropriate.
This operation is not going to necessarily give you the structure above i.e. man
and R
folders or a DESCRIPTION
file, which can be done with the use_description()
function from the usethis
package.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With