Learn R Programming

mtconnectR (version 1.2.1)

add_data_item_to_mtc_device: Add a new data item to an existing MTC Device Class

Description

Add a new data item to an existing MTC Device Class

Usage

add_data_item_to_mtc_device(mtc_device, data_item_data, data_item_name,
  category = "EVENT")

Arguments

mtc_device

An existing object of MTCDevice Class

data_item_data

Data for the new data item to add

data_item_name

Name of the new data item

category

Category of the new data item. Can be EVENT or SAMPLE

Examples

Run this code
# NOT RUN {
data_item_data = data.frame(timestamp = as.POSIXct(c(0.5, 1, 1.008, 1.011) +
                                        1445579573,  tz = 'CST6CDT', origin = "1970-01-01"),
                            value = c("a", "b", "c", "d"))
data("example_mtc_device")
mtc_device_updated =
   add_data_item_to_mtc_device(example_mtc_device, data_item_data,
    data_item_name = "test", category = "EVENT")
print(mtc_device_updated)
# }

Run the code above in your browser using DataLab