Framework for R

Project Management

adopt()

Adopt an Existing Project Folder

Turns a folder you already work in into a Framework project without moving anything. adopt() looks at the folder names (never file names or contents, and at most three levels deep), proposes which Framework directory each one is, and lets you accept, change a role, or leave a folder out. It then writes settings.yml (a single file) and .framework/spec.json describing the folders as they are. Nothing else is created, moved, or overwritten, and scaffold() works afterwards.

Usage

adopt(path = ".", yes = FALSE)

Arguments

Name Default Description
path "."

The project folder (default: the working directory).

yes FALSE

If TRUE, accept the proposed mapping without asking. Required in a non-interactive session.

Value

Invisibly, a list with directories and extra_directories as written.

Details

Folders whose path contains "private" are flagged: consider the Privacy Sensitive structure for that project, and keep those folders out of git.

When you are signed in to Framework Cloud and run adopt() interactively, it then offers to register the project (which writes its project token to .env, making sure git ignores .env first) and to save the layout as a structure. Both default to No.

Examples

Not run

if (FALSE) {
adopt("~/projects/old-study")
adopt(yes = TRUE)
}

Related reference