View source: R/sidfex.read.obs.R
sidfex.read.obs | R Documentation |
Read observations corresponding to one or more SIDFEx targets. Optionally (default), in case of multiple data points (rows) valid for the same position time and coordinates, only the first is used, and data points with NA_values in any of the columns relevant for the trajectories (time and loaction) will be removed.
sidfex.read.obs(index = NULL, TargetID = NULL, data.path = NULL, NA_values = -999,
unique_POS_time = TRUE, add_RelTimeDay_Ref = "firstobs")
index |
an index data frame specifying the SIDFEx forecasts for which the corresponding observations are to be read. Used only if |
TargetID |
a character or character vector specifying which observations are to be read. If |
data.path |
|
NA_values |
a numeric scalar or vector specifying one or more values to be considered |
unique_POS_time |
a logical value specifying whether or not in case of multiple data points (rows) valid for the same position time and coordinates, all rows expect the first shall be removed. Default is |
add_RelTimeDay_Ref |
this argument specifies whether a column with a relative time axis (days since ...) shall be added. Valid values are |
If observations for more than one TargetID
are read based on the argument index
, a list with the two elements: index.map
maps the rows in index
to the Target IDs, and res.list
is a list with one entry (a list with the entries filename
, TargetID
, RelTime_RefYearDOY
, and data
) for each Target ID.
If observations for more than one TargetID
are read based on the argument TargetID
, a list with one entry (a list with the entries filename
, TargetID
, RelTime_RefYearDOY
, and data
) for each Target ID.
If observations for just one TargetID
, not matter if based on which argument, a list with the entries filename
, TargetID
, and data
.
Helge Goessling
sidfex.download.obs
, sidfex.read.fcst
# Download observations corresponding to an IABP buoy with IMEI 300234063991680
res = sidfex.download.obs(TargetID="300234063991680")
# Read the data
dat = sidfex.read.obs(TargetID="300234063991680")
# Show the data header
head(dat$data)
# Make a line plot for the latitude against the relative time axis
plot(dat$data$RelTimeDay,dat$data$Lat,type="l")
# Note that for this buoy, the plot reveals spurious data points at the beginning where the buoy hadn't been deployed yet
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.