View source: R/dbpf_sensor_add.R
dbpf_sensor_add | R Documentation |
Adds a new sensor to DB and tests for possible duplicate sensor lable.
dbpf_sensor_add(
con,
label,
type_of_measurement,
unit_of_measurement,
accuracy,
precision,
height_in_metres = 0,
serial_number = "",
mode = "test"
)
con |
Database connection object, as returned by |
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) |
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.
Test results as well as sensor id if data was inserted.
Stephan Gruber <stephan.gruber@carleton.ca>
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.