Learn R Programming

oce (version 1.8-3)

[[<-,adp-method: Replace Parts of an adp Object

Description

In addition to the usual insertion of elements by name, note that e.g. pitch gets stored into pitchSlow.

The [[<- method works for all oce objects. The purpose, as with the related extraction method, [[, is to insulate users from the internal details of oce objects, by looking for items within the various storage slots of the object. Items not actually stored can also be replaced, including units and data-quality flags.

Usage

# S4 method for adp
[[(x, i, j, ...) <- value

Arguments

x

an adp object.

i

character value naming the item to replace.

j

optional additional information on the i item.

...

optional additional information (ignored).

value

The value to be placed into x, somewhere.

Author

Dan Kelley

Details

As with [[ method, the procedure works in steps.

First, the metadata slot of x is checked to see whether it contains something named with i. If so, then the named item is replaced with value.

Otherwise, if the string value of i ends in Unit, then the characters preceding that are taken as the name of a variable, and the metadata slot of x is updated to store that unit, e.g.

x[["temperatureUnits"]] <- list(unit=expression(degree*F),scale="")

Similarly, if i ends in Flag, then quality-control flags are set up as defined by result, e.g.

o[["temperatureFlags"]] <- c(2,4,2,2)

Otherwise, pmatch() is used for a partial-string match with the names of the items that are in the data slot of x. The first item found (if any) is then updated to hold the value result.

If none of these conditions is met, a warning is issued.

See Also

Other functions that replace parts of oce objects: [[<-,amsr-method, [[<-,argo-method, [[<-,bremen-method, [[<-,cm-method, [[<-,coastline-method, [[<-,ctd-method, [[<-,echosounder-method, [[<-,g1sst-method, [[<-,gps-method, [[<-,ladp-method, [[<-,landsat-method, [[<-,lisst-method, [[<-,lobo-method, [[<-,met-method, [[<-,oce-method, [[<-,odf-method, [[<-,rsk-method, [[<-,sealevel-method, [[<-,section-method, [[<-,tidem-method, [[<-,topo-method, [[<-,windrose-method, [[<-,xbt-method

Other things related to adp data: [[,adp-method, ad2cpCodeToName(), ad2cpHeaderValue(), adp, adp-class, adpAd2cpFileTrim(), adpConvertRawToNumeric(), adpEnsembleAverage(), adpFlagPastBoundary(), adpRdiFileTrim(), adp_rdi.000, applyMagneticDeclination,adp-method, as.adp(), beamName(), beamToXyz(), beamToXyzAdp(), beamToXyzAdpAD2CP(), beamToXyzAdv(), beamUnspreadAdp(), binmapAdp(), enuToOther(), enuToOtherAdp(), handleFlags,adp-method, is.ad2cp(), plot,adp-method, read.adp(), read.adp.ad2cp(), read.adp.nortek(), read.adp.rdi(), read.adp.sontek(), read.adp.sontek.serial(), read.aquadopp(), read.aquadoppHR(), read.aquadoppProfiler(), rotateAboutZ(), setFlags,adp-method, subset,adp-method, subtractBottomVelocity(), summary,adp-method, toEnu(), toEnuAdp(), velocityStatistics(), xyzToEnu(), xyzToEnuAdp(), xyzToEnuAdpAD2CP()