R: Set Something in an oce metadata Slot

oceSetMetadata {oce} | R Documentation

## Set Something in an oce metadata Slot

### Description

Create a copy of an object in which some element of its `metadata` slot has been altered, or added.

### Usage

    oceSetMetadata(object, name, value, note = "")

### Arguments

`object` | an oce object.
`name` | String indicating the name of the `metadata` item to be set.
`value` | Value for the item.
`note` | Either empty (the default), a character string, or `NULL`, to control additions made to the processing log of the return value. If `note=""` then an entry is created based on deparsing the function call. If `note` is a non-empty string, then that string gets added added to the processing log. Finally, if `note=NULL`, then nothing is added to the processing log. This last form is useful in cases where `oceSetData` is to be called many times in succession, resulting in an overly verbose processing log; in which case, it might helpful to use processingLog<- to add a summary entry to the object's processing log.

### Value

An oce object, the `metadata` slot of which has been altered either by adding a new item or modifying an existing item.

### Author(s)

Dan Kelley

### See Also

Other things related to the metadata slot: `oceDeleteMetadata()`, `oceGetMetadata()`, `oceRenameMetadata()`

### Examples

    # Add an estimate of MLD (mixed layer depth) to a ctd object
    library(oce)
    data(ctd)
    ctdWithMLD <- oceSetMetadata(ctd, "MLD", 3)
    ctdWithMLD[["MLD"]] # 3

[Package oce version 1.7-2 Index]