Description Usage Arguments Value References See Also
This function writes either an xts
object or a data.frame
to an InfluxDB server.
In case of an xts object, columnnames of the xts
object are used as InfluxDB's field keys,
xts
's coredata represent field values. Attributes are preserved and written
as tag keys and values, respectively.
In case of a data.frame
, columns may represent times and both tag and field values.
Columnnames of the data.frame
object are used as InfluxDB's tag and field keys.
Times and tags are optional. Use parameter time_col
and tag_col
to define
the interpretation. By specifiying one of the arguments measurement
or measurement_col
,
a data.frame may contain data from one measurement or multiple measurements, respectively.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | influx_write(x, con, db, measurement, rp = NULL, precision = c("s",
"ns", "u", "ms", "m", "h"), consistency = c(NULL, "one", "quroum",
"all", "any"), max_points = 5000, use_integers = FALSE, ...)
## S3 method for class 'xts'
influx_write(x, con, db, measurement, rp = NULL,
precision = c("s", "ns", "u", "ms", "m", "h"), consistency = c(NULL,
"one", "quroum", "all", "any"), max_points = 5000,
use_integers = FALSE, ...)
## S3 method for class 'data.frame'
influx_write(x, con, db, measurement = NULL,
rp = NULL, precision = c("s", "ns", "u", "ms", "m", "h"),
consistency = c(NULL, "one", "quroum", "all", "any"),
max_points = 5000, use_integers = FALSE, time_col = NULL,
tag_cols = NULL, measurement_col = NULL, ...)
|
x |
The object to write to an InfluxDB server (either of class |
con |
An |
db |
Sets the target database for the query. |
measurement |
Sets the name of the measurement (data.frame has data to
write to one measurement only). If both arguments |
rp |
Sets the target retention policy for the write. If not present the default retention policy is used. |
precision |
Sets the precision of the supplied Unix time values ("s", "ns", "u", "ms", "m", "h"). If not present timestamps are assumed to be in seconds. |
consistency |
Set the number of nodes that must confirm the write. If the requirement is not met the return value will be partial write if some points in the batch fail, or write failure if all points in the batch fail. |
max_points |
Defines the maximum points per batch (defaults to 5000). |
use_integers |
Should integers (instead of doubles) be written if present? |
... |
Arguments to be passed to methods. |
time_col |
A character scalar naming the time index column. |
tag_cols |
A character vector naming tag columns. |
measurement_col |
A character scalar naming the measurement column
(data.frame has data to write to multiple measurements). Overrides
|
A list of server responses.
https://docs.influxdata.com/influxdb/
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.