-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathsub-subset-met-method.Rd
93 lines (81 loc) · 3.14 KB
/
sub-subset-met-method.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/met.R
\name{[[<-,met-method}
\alias{[[<-,met-method}
\title{Replace Parts of a met Object}
\usage{
\S4method{[[}{met}(x, i, j, ...) <- value
}
\arguments{
\item{x}{a \linkS4class{met} object.}
\item{i}{character value naming the item to replace.}
\item{j}{optional additional information on the \code{i} item.}
\item{...}{optional additional information (ignored).}
\item{value}{The value to be placed into \code{x}, somewhere.}
}
\description{
The \code{[[<-} method works for all \linkS4class{oce} objects.
The purpose, as with the related extraction method, \code{[[},
is to insulate users from the internal details of \linkS4class{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.
}
\details{
As with \code{[[} method, the procedure works in steps.
First, the \code{metadata} slot of \code{x} is checked to
see whether it contains something named with \code{i}.
If so, then the named item is replaced with \code{value}.
Otherwise, if the string value of \code{i} ends in \code{Unit}, then the
characters preceding that are taken as the name of a variable, and
the \code{metadata} slot of \code{x} is updated to store that unit, e.g.
\if{html}{\out{<div class="sourceCode">}}\preformatted{x[["temperatureUnits"]] <- list(unit=expression(degree*F),scale="")
}\if{html}{\out{</div>}}
Similarly, if \code{i} ends in \code{Flag}, then quality-control
flags are set up as defined by \code{result}, e.g.
\if{html}{\out{<div class="sourceCode">}}\preformatted{o[["temperatureFlags"]] <- c(2,4,2,2)
}\if{html}{\out{</div>}}
Otherwise, \code{\link[=pmatch]{pmatch()}} is used for a partial-string match with
the names of the items that are in the \code{data} slot of \code{x}.
The first item found (if any) is then updated to hold the value \code{result}.
If none of these conditions is met, a warning is issued.
}
\seealso{
Other functions that replace parts of oce objects:
\code{\link{[[<-,adp-method}},
\code{\link{[[<-,amsr-method}},
\code{\link{[[<-,argo-method}},
\code{\link{[[<-,bremen-method}},
\code{\link{[[<-,cm-method}},
\code{\link{[[<-,coastline-method}},
\code{\link{[[<-,ctd-method}},
\code{\link{[[<-,echosounder-method}},
\code{\link{[[<-,g1sst-method}},
\code{\link{[[<-,gps-method}},
\code{\link{[[<-,ladp-method}},
\code{\link{[[<-,landsat-method}},
\code{\link{[[<-,lisst-method}},
\code{\link{[[<-,lobo-method}},
\code{\link{[[<-,oce-method}},
\code{\link{[[<-,odf-method}},
\code{\link{[[<-,rsk-method}},
\code{\link{[[<-,sealevel-method}},
\code{\link{[[<-,section-method}},
\code{\link{[[<-,tidem-method}},
\code{\link{[[<-,topo-method}},
\code{\link{[[<-,windrose-method}},
\code{\link{[[<-,xbt-method}}
Other things related to met data:
\code{\link{[[,met-method}},
\code{\link{as.met}()},
\code{\link{download.met}()},
\code{\link{met}},
\code{\link{met-class}},
\code{\link{plot,met-method}},
\code{\link{read.met}()},
\code{\link{subset,met-method}},
\code{\link{summary,met-method}}
}
\concept{functions that replace parts of oce objects}
\concept{things related to met data}