make_prj_tree | R Documentation |
Create a files structure from a builtin template or from a customized template provided as .json file
make_prj_tree(json_str, file, path = ".", verbose = FALSE)
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 |
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.
invisible, an R list that corresponds to the JSON object in
json_str
, as returned by rjson::fromJSON
.
rprojtree::print_template
,
rprojtree::available_templates
,
rjson::fromJSON
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.