setup_files: Create standard project directories

Description Usage Arguments Examples

View source: R/setup.R

Description

Create standard project directories

Usage

1
2
setup_files(..., .list = list(file.path(grep("/out$", list.dirs("."),
  value = TRUE), "README.md"), . = c("README.md", "Makefile")))

Arguments

...

named characters where name=directory_name and value=filenames, or unnamed characters where value=filepaths. Paths can be relative.

.list

as an alternative to ..., use .list to specify files in a single list argument

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# prep
dir.create('example_project')
setwd('example_project')

dirs <- setup_dirs('2_data','3_analyze','4_report','explore',default='cdos')
setup_files() # use the default as given for .list
setup_files('2_data/src'=c('data1.R','data2.R','helper-data.R'))

# clean up
setwd('..')
unlink('example_project', recursive=TRUE)

USGS-R/scipiper documentation built on Aug. 14, 2018, 5:23 a.m.