Learn R Programming

muma (version 1.4)

work.dir: Create a working directory

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

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.

Examples

Run this code

## 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")
  }

Run the code above in your browser using DataLab