Temperature and pressure
Updated on 2024-05-07 22:40:57
Using the ecotopia_data_devices_env function in the EcotopiaR package, you can get environment (ENV) data and create scatter plots with ggplot2 to visualize the relationship between internal temperature and internal pressure changes. The internal temperature and pressure can reflect the operational status and health condition of the device. High or low temperatures and abnormal pressures may indicate device malfunctions or the need for maintenance. By monitoring this data, you can ensure the reliability and accuracy of the device in the research, avoiding data loss or errors caused by device failures.
In the example below, EcotopiaR gets ENV data from a device over a period of 100 days and generates a scatter plot of internal temperature and pressure. It can be observed that there is a strong positive correlation between internal pressure and internal temperature in a normal device.
Example
# Chart of inner temperature and inner pressure # Import EcotopiaR library(EcotopiaR) library(ggplot2) now <- Sys.time() attr(now, "tzone") <- "UTC" start_time <- now - as.difftime(100, unit = "days") data_list <- ecotopia_data_devices_env( # The device uuid can be viewed in the list of devices # obtained through ecotopia_data_devices. device_uuids = c("5d395935879cb58613e59e76"), show_progress = "FULL", start_time = start_time ) data <- data_list[["5d395935879cb58613e59e76"]] data$inner_temperature <- as.numeric(data$inner_temperature) data$inner_pressure <- as.numeric(data$inner_pressure) # Bar chart of inner temperature plot <- ggplot(data, aes(x = inner_temperature, y = inner_pressure)) + geom_point(color = "green") + geom_smooth(method = "lm") + labs(title = "Inner Temperature And Pressure", x = "Inner Temperature", y = "Inner Pressure") ggsave("examples/env_temperature_pressure_point.png", plot)
Copied!