readProfiles | R Documentation |
This works with either a vector of NetCDF files,
or a argoFloats
object of type "profiles"
, as
created by getProfiles()
.
During the reading, argo profile objects are created with oce::read.argo()
or a replacement function provided as the FUN
argument.
readProfiles(
profiles,
FUN,
destdir = argoDefaultDestdir(),
quiet = FALSE,
debug = 0
)
profiles |
either (1) a character vector that holds
the names of NetCDF files or (2) an |
FUN |
a function that reads the NetCDF files in which the argo
profiles are stored. If |
destdir |
character value indicating the directory in which to store
downloaded files. The default value is to compute this using
|
quiet |
logical value; use |
debug |
an integer specifying the level of debugging. If
this is zero, the work proceeds silently. If it is 1,
a small amount of debugging information is printed. Note that
|
By default, warnings are issued about any
profiles in which 10 percent or more of the measurements are flagged
with a quality-control code of 0, 3, 4, 6, 7, or 9 (see the
applyQC()
documentation for the meanings of these codes). For more
on this function, see section 2 of Kelley et al. (2021).
An argoFloats
object
with type="argos"
, in which the data
slot
contains a list named argos
that holds objects
that are created by oce::read.argo()
.
Dan Kelley
Kelley, D. E., Harbin, J., & Richards, C. (2021). argoFloats: An R package for analyzing Argo data. Frontiers in Marine Science, (8), 636922. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.3389/fmars.2021.635922")}
# # Omit this, because rhub errors out, evidently because it is running donttest blocks.
# # Example 1: read 5 profiles and plot TS for the first, in raw and QC-cleaned forms.
# # This example involves downloading to a local repository, so it is not run on CRAN.
#
# library(argoFloats)
# data(index)
# index1 <- subset(index, 1)
# profiles <- getProfiles(index1)
# raw <- readProfiles(profiles)
# clean <- applyQC(raw)
# par(mfrow=c(1, 2))
# file <- gsub(".*/", "", profiles[[1]])
# aWithNA <- clean[[1]]
# oce::plotTS(raw[[1]], eos="unesco", type="o")
# mtext(file, cex=0.7*par("cex"))
# aWithoutNA <- raw[[1]]
# oce::plotTS(clean[[1]], eos="unesco", type="o")
# mtext(paste(file, "\n (after applying QC)"), cex=0.7*par("cex"))
#
#
# Read from a local file
f <- system.file("extdata", "SR2902204_131.nc", package = "argoFloats")
p <- readProfiles(f)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.