influxr_query: Perform a query on InfluxDB instance.

influxr_queryR Documentation

Perform a query on InfluxDB instance.

Description

influxr_query

Usage

influxr_query(
  client,
  query = "",
  database = "",
  precision = c("ms", "ns", "u", "s", "m", "h"),
  return_type = c("data.table", "data.frame", "plain.text", "xts"),
  col_names = TRUE,
  missing = c(-9999, -9999.99, -9999.9999),
  missing_replacement = NA,
  ignore_name = TRUE,
  ignore_tags = TRUE,
  write_handler = NULL,
  verbose = FALSE,
  ...
)

Arguments

client

InfluxDB connection object, created with influxr_connection

query

character. Query statement in influxDB query language 'InfluxQL'

precision

character. Timestamp precision of returned results, defaults to milliseconds with a range of options from nanosecond to hour.

return_type

character. Type of returned result. Default to 'data.table'.

col_names

logical. Whether to return the column names from influxDB variable names.

missing

Vector. Values to be considerd as missing values.

missing_replacement

What to replace missing values with.

ignore_name

logical. Whether to remove the name variable from the returned result from influx.

ignore_tags

logical. Whether to keep influx measurement tags as variables in the returend result.

...

Further arguments to be passed to the write_handler function.

databse

character, representing the database to name to run the query against.

write_hanler

function. A function to handle writing to disk. If provided, query results to be written to disk will be passed to the function under an argument named x. Chunk number will be passed as an argument named chunk_number. the build in function timed_rotating_file can be used as write handler. default is NULL.

Details

Note on time zones: the time stamp of the returned query will be converted from the server timezone ('UTC') to the local system timezone obtained by Sys.timezone() unless the environment variable 'TZ' is not empty then its value will be applied to the returned timestamp.


influxr/influxr documentation built on May 1, 2024, 2:07 a.m.