create_cabinet: Create a cabinet template

Description Usage Arguments Details Value See Also

View source: R/cabinets.R

Description

create_cabinet writes code to the .Rprofile file so that when new R sessions are started, the newly created cabinet, an R6 object of class FileCabinet, is available in the global environment as a hidden object. The cabinet simply stores file location and file template information that new_cabinet_proj uses to create new projects with the pre-defined structure.

Usage

1
create_cabinet(name, directory, structure, .alias = name)

Arguments

name

Name of the cabinet; character of length 1. This is how the cabinet will be referenced, so best to chose something memorable.

directory

The file path for where the cabinet will exist.

structure

A list of paths of folders/files to create. See details for further explanation.

.alias

An optional name for the object the cabinet will be stored in R as. Defaults to name.

Details

Before writing to or creating a .Rprofile file, cabinets will explicitly ask for the user's permission to on exit. The cabinet structure should be defined using a list with the names defining folder paths. List values should be set to NULL.

Value

An R6 object of class FileCabinet. The code to generate this object is written to the .Rprofile file of the home directory.

See Also

new_cabinet_proj


nt-williams/Nworkr documentation built on Nov. 10, 2020, 6:14 p.m.