addOn {GCDkit}R Documentation

Replacing missing data by values

Description

Add missing columns ("what") to a matrix "where", fill with "value".

Usage

addOn(what,value=NA,where=WR)

Arguments

what

character or numeric, specifies the column in the matrix where

value

numeric vector with the replacement

where

a matrix in which the replacement is to be done

Details

The function serves two purposes. If a column with the name 'what' does not exist in the numeric data matrix where, it appends a new column and fills it with 'value'.

On the other hand, if the column 'what' does exist, the function attempts to replace only the empty (NA) values by the specified values '(value)'.

Value

Modifies the matrix WR.

Author(s)

Vojtech Janousek, vojtech.janousek@geology.cz


[Package GCDkit version 4.0 Index]