Package 'rprojtree'

Title: Create Folders and Files Structure for Data Science Projects
Description: Use JSON templates to create folders and files structure for data science projects. Includes customized templates and accepts your own as JSON files.
Authors: Miguel Conde
Maintainer: Miguel Conde <[email protected]>
License: GPL (>= 3)
Version: 1.0.0
Built: 2025-02-14 05:27:04 UTC
Source: https://github.com/miguel-conde/rprojtree

Help Index


rprojtree

Description

This package allows you to easily create file and directory structures for data science projects

Details

For more details see the tutorial vignette:

  • vignette("rprojtree-primer", package = "rprojtree")

See Also

Useful links:


available_templates

Description

available_templates

Usage

available_templates()

Details

These are the structures defined by the currently available builtin templates:

  • basic_template

    • data/

      • clean/

      • raw/

    • docs/

    • outputs/

      • files/

      • reports/

    • R/

      • global.R

      • scripts/

      • src/

  • py_template

    • data/

      • clean/

      • raw/

    • docs/

    • outputs/

      • files/

      • reports/

    • PYTHON/

      • setup.py

      • notebooks/

      • projpkj/

        • __init__.py

      • scripts/

      • tests/

  • py_r_template: a combination of basic_template and py_template

Value

A character list with the names of the built-in templates available in the package

Examples

available_templates()

make_prj_tree

Description

Create a files structure from a builtin template or from a customized template provided as .json file

Usage

make_prj_tree(json_str, file, path = ".", verbose = FALSE)

Arguments

json_str

string with the name of the builtin template to use

file

string for the name of the .json file describing a customized files structure to use as template

path

string containing which directory to use as root of the files structure to create

verbose

logical, show or not info while creating the files structure

Details

  • Only one of json_str or file must be supplied.

  • An error is raised if any node in the .json structure is found malformed

JSON format:

  • All the nodes must have a type and a name. Allowed types are dir, for directories, and file for files.

  • All the directory nodes can contain any number of sub-nodes for subdirectories

  • The file nodes can include a content field for the text the file should contain.

Value

invisible, an R list that corresponds to the JSON object in json_str, as returned by rjson::fromJSON.

See Also

rprojtree::print_template, rprojtree::available_templates, rjson::fromJSON

Examples

## Not run: 
root_path = "..."
make_prj_tree(json_str = "basic_template", path = root_path)

my_template <- ".../some_template.json"
make_prj_tree(file = my_template, path = root_path)

## End(Not run)