
data.frame
with temporal observations,
using IDs and start and ending dates or years.mksub(x, start, end, id)
Date
or year; if omitted will use
same year as start
, and if start
is omitted, will use
maximum yearx
as x$id
; it is used to extract a
subset of data from a sinlge IDdata.frame
with the same columns
and attributes as x
, except id
, which will be retained
as an attribute (e.g., attr(x,"id")
).data.frame
with multiple stations or sets. The x
object can have many columns, representing measured variables for each
day, which will be returned with their original attributes.
If id
is used, that station will be extracted from
x
. If id
is not provided, but there are more than one
unique IDs in x$id
, the first unique ID will be extracted, with
a warning.read.msc
, mscdata
data(mscstn)
data(mscdata)
# All available data from one station
summary(mksub(mscdata, id=1108447))
# One year
str(mksub(mscdata, id=1108447, start=1980))
# A range of years
str(mksub(mscdata, id=1108447, start=1980, end=1989))
# A range of dates
summary(mksub(mscdata, id=1108447,
start=as.Date("1975-08-01"),
end=as.Date("2000-07-31")))
Run the code above in your browser using DataLab