Skip to contents

Initialize a project to keep track of separate dataset repositories and distributions.

Usage

init_datacommons(dir, name = "Data Commons", repos = NULL,
  default_user = "", remote = NULL, url = NULL, refresh_after = FALSE,
  overwrite = FALSE, serve = FALSE, host = "127.0.0.1", port = 3000,
  use_local = FALSE, verbose = interactive())

Arguments

dir

Path to the desired data commons directory.

name

Name of the data commons.

repos

A vector of repository names to add to commons.json.

default_user

GitHub username to prepend to repository names if needed.

remote

Name of the data commons' GitHub repository ("username/reponame").

url

URL of the data commons' monitor site; defaults to the GitHub Pages URL associated with remote if provided ("https://username.github.io/reponame").

refresh_after

Logical; if FALSE, will not run datacommons_refresh after initiating the project. Defaults to TRUE when first creating a data commons project.

overwrite

Logical; if TRUE, will overwrite existing datacommons files in dir. The included .js and .sh files are always rewritten, and if name, repos, or default_user is specified, commons.json will also be rewritten regardless of overwrite.

serve

Logical; if TRUE, will serve the docs directory.

host

The IPv4 address to listen to if serve is TRUE; defaults to "127.0.0.1".

port

The port to listen on if serve is TRUE; defaults to 3000.

use_local

Logical; if TRUE, will use a datacommons.js script located in a local dist/docs/dev directory, relative to dir.

verbose

Logical; if FALSE, suppresses messages.

Value

Path to the datacommons directory.

Details

The shell scripts included in the project's scripts directory can be used to retrieve and update repositories over SSH.

This will clone or pull repositories listed in scripts/repos.txt: sh scripts/get_repos.sh

This will add, commit, and push all changes in all repositories: sh scripts/update_repos.sh "commit message"

Examples

if (FALSE) {
init_datacommons(
  "../datacommons",
  name = "Data Commons",
  remote = ""
)
}