dbpf_sensor_add: Adds a new sensor to DB

View source: R/dbpf_sensor_add.R

dbpf_sensor_addR Documentation

Adds a new sensor to DB

Description

Adds a new sensor to DB and tests for possible duplicate sensor lable.

Usage

dbpf_sensor_add(
  con,
  label,
  type_of_measurement,
  unit_of_measurement,
  accuracy,
  precision,
  height_in_metres = 0,
  serial_number = "",
  mode = "test"
)

Arguments

con

Database connection object, as returned by dbpf_con

label

Name for the new sensor.

type_of_measurement

'numeric' or 'text'

unit_of_measurement

Character string, give SI unit used.

accuracy

Accuracy in units used.

precision

Precision (absolute) given in the units used.

height_in_metres

Positive number above ground, negative below ground.

serial_number

Serial number, usuall left empty

mode

= Can be 'test' (default, read-only) or 'insert' (will insert into DB)

Details

Run in test mode first. If you have no DB login to write data, run in test mode with your login and then pass to someone who does. Note a sensor_id must be linked to a device_id using devices_sensors_add.

Value

Test results as well as sensor id if data was inserted.

Author(s)

Stephan Gruber <stephan.gruber@carleton.ca>

Examples

## Not run: 
con <- dbpf_con()
dbpf_sensor_add(con,
                "vegetation_height_max", type_of_measurement = "numeric",
                unit_of_measurement = "m", accuracy = 0.5, precision=0.01,
                height_in_metres = 0, serial_number = "", mode = 'test')
dbDisconnect(con)

## End(Not run)

geocryology/PermafrostDB documentation built on April 17, 2025, 11:54 a.m.