collectClumppOutput: Collect CLUMPP output files from multiple folders

Description Usage Arguments Details Value Examples

View source: R/pophelper.R

Description

Collect CLUMPP output files from multiple folders to one folder

Usage

1
2
3
4
5
6
collectClumppOutput(
  prefix = "pop",
  filetype = "aligned",
  runsdir = NULL,
  newdir = NULL
)

Arguments

prefix

A character indicating the prefix of the CLUMPP directories before the underscore. For ex. if the directories are pop_K2, then prefix is pop.

filetype

A character indicating the type of file to be copied. Options are 'aligned' to copy aligned files only, 'merged' to copy merged files only and 'both' to copy both files.

runsdir

A character path denoting the directory containing CLUMPP output files in multiple directories. To use the current working directory, set runsdir=getwd(). Use choose.dir() for interactively selecting the directory.

newdir

A character path indicating the name of the new output directory to be created with the collected runs.

Details

Within each CLUMPP output folder, the function searches for filenames containing combination of prefix and filetype. This file is copied to the new folder. Therefore, do not manually rename CLUMPP output files or output directories.

See the vignette for more details.

Value

Two integers are returned. The first denotes the number of directories processed. The second number denotes the number files copied.

Examples

1
2
3
4
5
## Not run: 
collectClumppOutput(runsdir=getwd(),newdir="output")
collectClumppOutput(prefix="pop",filetype="both",runsdir="/path/",newdir="both")

## End(Not run)

royfrancis/pophelper documentation built on Jan. 1, 2021, 4:58 p.m.