kuenm_varcomb: All potential combinations of a group of variables

View source: R/kuenm_varcomb.R

kuenm_varcombR Documentation

All potential combinations of a group of variables

Description

kuenm_varcomb creates multiple sets of variables by grouping them in all their potential combinations.

Usage

kuenm_varcomb(var.dir, out.dir, min.number = 2, in.format = "ascii",
              out.format = "ascii")

Arguments

var.dir

(character) the name of the folder containing variables that will be combined.

out.dir

(character) the name of the folder in which subfolders with distinct combinations of variables will be written.

min.number

(integer) the minimum number of variables per combination. This number must be > 1. Default = 2.

in.format

(character) format of variables in var.dir. Options are "ascii", "GTiff", and "EHdr" = bil. Default = "ascii".

out.format

(character) format of variables to be written in distinct sets inside out.dir. Options are "ascii", "GTiff", and "EHdr" = bil. Default = "ascii".

Details

Sest of variables are written in the working directory and not retained as RasterStacks to avoid problems related to RAM limitations.

Time of processing will be reduced considerably if in.format and out.format coincide because files will be copied and not loaded and written.

Value

A list containing vectors of all the potential combinations of variables. In addition, a folder named out.dir with subfolders in which distinct combinations of variables produced are written.

Examples

# This example depends on data stored in your directory
var_dir <- "Variables" # your directory with variables to be combined
out_dir <- "M_variables" # output directory to be created
min_n <- 2
in_format <- "ascii"
out_format <- "GTiff"

comb <- kuenm_varcomb(var.dir = var_dir, out.dir = out_dir, min.number = min_n,
                      in.format = in_format, out.format = out_format)

manubio13/ku.enm documentation built on Jan. 5, 2024, 5:55 a.m.