addOn {GCDkit} | R Documentation |
Add missing columns ("what") to a matrix "where", fill with "value".
addOn(what,value=NA,where=WR)
what |
character or numeric, specifies the column in the matrix |
value |
numeric vector with the replacement |
where |
a matrix in which the replacement is to be done |
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
)'.
Modifies the matrix WR
.
Vojtech Janousek, vojtech.janousek@geology.cz