| subsetrect {ssBase} | R Documentation |
Selects events within a specified rectangular selection criteria from a given
catalogue. Note that subset.rect is deprecated; it conflicts with the generic function subset. Change to subsetrect; it has the same arguments.
subsetrect(x, minlong=0, maxlong=360, minlat=-90, maxlat=90,
mindepth=0, maxdepth=Inf, minmag=-Inf, maxmag=Inf,
minday=-Inf, maxday=Inf, report.count=TRUE, na.rm=TRUE,...)
# Deprecated Usage:
subset.rect(x, minlong=0, maxlong=360, minlat=-90, maxlat=90,
mindepth=0, maxdepth=Inf, minmag=-Inf, maxmag=Inf,
minday=-Inf, maxday=Inf, report.count=TRUE, na.rm=TRUE,...)
x |
catalogue name. |
minlong |
minimum longitude, or western boundary. Specified as degrees east of Greenwich (0 to 360). |
maxlong |
maximum longitude, or eastern boundary. Specified as degrees east of Greenwich (0 to 360). |
minlat |
minimum latitude, or southern boundary. Specified as degrees north (positive) or south (negative) of the equator (-90 to 90). |
maxlat |
maximum latitude, or northern boundary. Specified as degrees north (positive) or south (negative) of the equator (-90 to 90). |
mindepth |
minimum depth in kilometres. |
maxdepth |
maximum depth in kilometres. |
minmag |
minimum magnitude. |
maxmag |
maximum magnitude. |
minday |
the number of days (and fractions) after 00:00 hrs on 1 January 1970 from which events are required. See Details. |
maxday |
the number of days (and fractions) after 1 January 1970 denoting the upper bound of the time interval containing the required events. See Details. |
report.count |
Boolean. Report the number of events referred to by the new subset. Default is
TRUE.
|
na.rm |
Boolean. Determines whether those events with missing values of the subsetting variables should be excluded, see Details. Default is TRUE.
|
... |
other options for restricting catalogue data. These must take the form option == value, where option is a component of the specified catalogue.
|
The subsetting is based on the catalogue variables latitude, longitude, depth, magnitude and time. The default settings for each of these variables is to take all events. The function only works through each of the “min” and “max” values included in your function call. Those arguments not explicitly listed will have no effect. A logical vector is constructed with the same length as the number of events in the catalogue, and indicates whether a given event satisfies the subsetting criteria. From this, the vector of indices of the required events is created.
Historical events often have missing values, particularly the magnitude and depth. Consider the situation where minmag=6. The logical vector within the function will contain TRUE's and FALSE's for those events that satisfy or not satisfy this condition, respectively. However, for those historical events with a missing magnitude (NA), the elements in the logical vector will also be NA. The argument na.rm determines whether these events should be removed (TRUE) or included (FALSE) in the subset. The default setting is to remove such events, though in the context of large historical events, it would be more sensible to include them, i.e. na.rm=FALSE.
The arguments minday and maxday represent the boundary points of the time interval, and can represent fractions of days. For example, 00:00 hrs on 1 Jan 1970 is represented as minday=0, whereas 18:00 hrs on 2 Jan 1970 is represented as minday=1.75. Similarly, 18:32:24 hrs on 30 Sept 1990 could be specified as minday = julian(9,30,1990) + 18/24 + 32/(24*60) + 24/(24*60*60). Note that maxday = julian(1,1,1990) represents the point 00:00 hrs on 1 Jan 1990, and therefore will not include events on 1 Jan 1990 after midnight.
Returns an object of type list with class "subset". All optional
arguments above are included as elements within the list. Other components
within the list are:
indices |
an array of indices for events in catalogue x satisfying the selection criteria.
|
catname |
catalogue name. |
type |
type of subset, set to "Rectangular".
|
subsetcircle, subsetpolygon,
subsetsphere, print.subset,
summary.subset
# Select events in the NZ55 catalogue between 1961 and 1992 with magnitude >=
7
data(NZ55)
a <- subsetrect(NZ55, minday=julian(1,1,1961), maxday=julian(1,1,1993),
minmag=7)
print(summary(a))
as.catalogue(a, "NZ7")
print(NZ7)