sectionSort | R Documentation |
Sections created with as.section()
have "stations" that are in the
order of the CTD objects (or filenames for such objects) provided. Sometimes,
this is not the desired order, e.g. if file names discovered with
dir()
are in an order that makes no sense. (For example, a
practioner might name stations "stn1"
, "stn2"
, etc., not
realizing that this will yield an unhelpful ordering, by file name, if there
are more than 9 stations.) The purpose of sectionSort
is to permit
reordering the constituent stations in sensible ways.
sectionSort(section, by, decreasing = FALSE)
section |
A |
by |
An optional string indicating how to reorder. If not provided,
|
decreasing |
A logical value indicating whether to sort in decreasing order. The default is FALSE. (Thanks to Martin Renner for adding this parameter.) |
object A section object that has been smoothed,
so its data fields will station-to-station variation than
is the case for the input section, x
.
Dan Kelley
Other things related to section data:
[[,section-method
,
[[<-,section-method
,
as.section()
,
handleFlags,section-method
,
initializeFlagScheme,section-method
,
plot,section-method
,
read.section()
,
section
,
section-class
,
sectionAddStation()
,
sectionGrid()
,
sectionSmooth()
,
subset,section-method
,
summary,section-method
library(oce)
data(section)
sectionByLongitude <- sectionSort(section, by = "longitude")
head(section)
head(sectionByLongitude)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.