sample() function
The sample()
function selects a subset of the records from the input table.
sample()
is a selector function.
sample(n:5, pos: -1)
Empty tables
sample()
drops empty tables.
Parameters
n
(Required) Sample every Nth element.
pos
Position offset from the start of results where sampling begins.
pos
must be less than n
.
If pos
is less than 0, a random offset is used.
Default is -1
(random offset).
tables
Input data.
Default is piped-forward data (<-
).
Examples
The following example uses data provided by the sampledata
package
to show how sample()
transforms data.
import "sampledata"
sampledata.int()
|> sample(n: 2, pos: 1)
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Flux and this documentation. To find support, the following resources are available:
InfluxDB Cloud customers can contact InfluxData Support.