Create a working directory

Share:

Description

Generic function to create a directory in the current working directory, with copying all the files in the current directory to the newly formed one. When using the whole package 'muma' this function is recommended, as many files and directories are created.

Usage

1
work.dir(dir.name)

Arguments

dir.name

A character string indicating the name of the new directory.

Details

When using the package 'muma' this function should be used at the beginning, as the newly formed directory became the working directory and all files generated and written will be putted here.

Author(s)

Edoardo Gaude, Dimitrios Spiliotopoulos, Francesca Chignola, Silvia Mari, Andrea Spitaleri and Michela Ghitti

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## The function is currently defined as
function (dir.name) 
{
    WorkinDir = paste(getwd(), "/", dir.name, "/", sep = "")
    dir.create(WorkinDir)
    file = list.files()
    file.copy(file, WorkinDir)
    setwd(WorkinDir)
    unlink("muma.R")
  }