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

For each of the 'nvar' items of the data.frame, starting at rank 'rank', the name is encoded according to the following convention.

The encoded name is of the form: 'radix'.'middle'.'end'.

The first part 'radix' is a simple duplicate of the input argument with the same name.

The 'middle' and 'end' part names follow the same algorithm. For its description, we refer to the generic name: i.e. 'type' instead of 'midtype' or 'fintype'. In some naming conventions, a new argument 'ivar' is used: it is calculated as "var0+i-1" where i stands for the variable index (varying from 1 to 'nvar').

The naming depends upon the value of the argument 'type'.

The syntax 'db.getname(db,loc,i)' returns the name of the variable (in Db) which corresponds to the i-th element assigned to the locator 'loc'. For example: db.getname(db,"z",3) returns the name of the variable assigned to the locator "z3".

If the encoded name should start with ".", this dot is omitted. This is the case when the argument 'radix' is set to "".

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 11.0.6 Index]