tab.rename {RGeostats}R Documentation

Naming convention for output variables in Db

Description

Naming convention for naming convention in Db

Usage

tab.rename(x, nvar = 1, rank = 1, db = NA, radix = NA, 
	   midtype = NA, midname = NA, midloc = "z", midvar0 = 1, midsep="",
	   fintype = NA, finname = NA, finloc = "z", finvar0 = 1, finsep="")

Arguments

x

This argument can be either:

This container has several variables whose names must be modified here.

nvar

Number of variables to be added

rank

Rank of the first variable to be named

db

A db-class where the input variable (defined with "z" locator) has been extracted. It is used when the input variable name is used when encoding the output variable name.

radix

Radix string

midtype

Type of the middle part of the encoded name

midname

Name for the middle part of the encoded name

midloc

Locator for the middle part of the encoded name

midvar0

Starting index for the middle part of the encoded name

midsep

Separator added between 'midname' and 'ivar' (only used when abs(midtype) = 1)

fintype

Type of the ending part of the encoded name

finname

Name of the ending part of the encoded name

finloc

Locator for the ending part of the encoded name

finvar0

Starting index for the ending part of the encoded name

finsep

Separator added between 'finname' and 'ivar' (only used when abs(fintype) = 1)

Details

This procedure renames the 'nvar' columns of a data.frame, starting from the column 'rank'. The name is composed according to the following rule.

The encoded name is of the form: 'radix'.'mid'.'end'. The two parts ('mid' and 'end') are constructed in the same manner: the description is given for a generic part called 'part'.

The 'radix' is simply duplicated from the argument 'radix'. If not defined, the following separator is skipped.

For the construction of each 'part, we use the relevant parameter 'part'type, 'part'name, 'part'loc, 'part'var0 and 'part'sep. The algorithm needs the definition of the index 'ivar' which varies 'var0' to 'var0 + nvar'. The algorithm is as follows, according to the value of 'part'type:

For the two last cases, note that if 'loc' is left to NA, the absolute rank of the variable is used (instead of the rank of the locator).

Value

The output has the same structure as the input (i.e. a db-class or a data frame) where the variables have been renamed.


[Package RGeostats version 14.0.10 Index]