View source: R/add_fair_theory.R
create_fair_theory | R Documentation |
Partly automates the process of creating a FAIR theory repository, see Details.
create_fair_theory(
path,
title = NULL,
theory_file = NULL,
remote_repo = NULL,
add_license = "cc0",
...
)
path |
Character, indicating the directory in which to create the FAIR theory. |
title |
Character, indicating the theory title. Default: |
theory_file |
Character, referring to existing theory file(s) to be
copied, or a new theory file to be created. Default |
remote_repo |
Name of a 'GitHub' repository that exists or should be
created on the current authenticated user's account, see
|
add_license |
PARAM_DESCRIPTION, Default: 'cc0' |
... |
Additional arguments passed to other functions. |
The following steps are executed sequentially:
Create a project folder at path
Initialize a local 'Git' repository at path
If remote_repo
refers to a user's existing 'GitHub' repository, add it
as remote to the local 'Git' repository. Otherwise, create a new 'GitHub'
repository by that name and add it as remote.
Add theory file. If theory_file
refers to an existing file, copy it to
path
. If theory_file
refers to a new file, create it in path
.
Add the license named by add_license
Add a README.md file
Add 'Zenodo' metadata so that it recognizes the repository as a FAIR theory
If it is possible to push to the remote repository, use
git_update
to push the repository to 'GitHub'
Invisibly returns a logical value, indicating whether the function was successful or not.
git_repo
add_license_file
, git_update
# Create a theory with no remote repository (for safe testing)
theory_dir <- file.path(tempdir(), "theory")
create_fair_theory(path = theory_dir,
title = "This is My Theory",
theory_file = "theory.txt",
remote_repo = NULL,
add_license = "cc0")
# Create a theory with a remote repository
## Not run:
theory_dir <- file.path(tempdir(), "theory_github")
out <- create_fair_theory(path = theory_dir,
title = "This is My GitHub Theory",
theory_file = "theory.txt",
remote_repo = "delete_test",
add_license = "ccby")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.