Initialize a new subdirectory in an existing repository, TNTP style.
Source:R/setup_repo.R
setup_subdirectory.Rd
A repository might represent a region, like "Anywhere City", or a major client or contract, like "Midwestern Charter Network. Within that repo you would have a subfolder for each analysis project. This function creates such a subfolder and populates it with folders and a README.
To use: within an existing repository on Bitbucket, set your your working directory to that folder and run this function to create a sub-folder.
Use setup_repo()
in a blank new repository to add the first project subfolder
and create the RProject and .gitignore files. Add subsequent analysis project folders
with this function.
Arguments
- project_path
the path to the main project directory. To use the current project, use `project_path = here::here()`.
- subfolder
a character vector containing the concise name of a project subfolder. E.g., if the repository is the name of a city "Anywhere City", a project subfolder might be "ela_access" or "aps_talent_landscape").
- proj_name
the longer, full name of the subfolder project. This will appear in the subfolder's README.md file.
- analyst_name
the name(s) of the analysts currently working on the subfolder project. This will appear in the subfolder's README.md file.
Examples
# Setting up in a temporary directory
setup_subdirectory(tempdir(),
subfolder = "ela_access",
proj_name = "Equitable Access to Grade-Level ELA",
analyst_name = "Dustin Pashouwer and Sam Firke")
#> ✔ Setting active project to "/tmp/Rtmp5JlxCL".
#> ✔ Creating R/.
#> ✔ Writing a sentinel file .here.
#> ☐ Build robust paths within your project via `here::here()`.
#> ℹ Learn more at <https://here.r-lib.org>.
#> ✔ Setting active project to "<no active project>".
#> Warning: "README.Md" already exists in subdirectory "ela_access"; no new "README.Md"
#> created.